I am using a Raspberry Pi 5, and one obviously necessary part of the project will be to access the GPIO pins to output signals to the stepper motor drivers. I can see that BBCSDL has gpiolib installed, but when I try this sample program..
Code: Select all
10 REM blink.bbc
20 REM Simple blink program in BBC BASIC
30 REM by Richard Russell, http://www.rtrussell.co.uk/
40
50 INSTALL @lib$+"gpiolib"
60
70 REM Initialise GPIO:
80 gpio% = FN_gpio_setup
90
100 REM Set GPIO pin 7 to output mode:
110 PROC_gpio_inp(gpio%, 7) : REM Must use PROC_gpio_inp() before PROC_gpio_out()
120 PROC_gpio_out(gpio%, 7)
130
140 pin7% = %10000000 : REM Bit mask
150 REPEAT
160 PROC_gpio_set(gpio%, pin7%)
170 WAIT 50 : REM 0.5 seconds
180 PROC_gpio_clr(gpio%, pin7%)
190 WAIT 50
200 UNTIL FALSE
210 END
Here is where I admit that I am not a programmer, and also struggle with Linux. My limited research tells me that gpiomem is a device, and that it is possible that only the root user can open it, which might explain the error message, though I'm not certain about this. Any help in trying to understand this will be gratefully received, especially if written in simple layman's terms!