Download the GPIO Module for RiscOS Pi from here: http://www.tankstage.co.uk/software.html - if you click on the first link on the page (the link is to a file named GPIO.zip) a download dialog window will pop up. In the window you will see a folder icon being displayed. Drag and drop the folder icon from the download dialog window to the SD card icon in the lower left corner of the RiscOS panel. RiscOS makes intense use of drag and drop, one of the things that are different from Windows or Linux.
Click on the sdcard icon mentioned above and a folder window will pop up containing more folders ('directories'). One of these is called GPIO. Double click on the GPIO folder and another folder window pops up. It contains two programs: !GPIOConfig and !PiLed as well as other files and folders. One of the files is called GPIO and its icon tells us that this is a 'module' file.
Now, to load the module in order to let RiscOS know about the RPi's GPIO hardware, we need to run a 'TaskWindow'. This is a command line tool that we need to load the module. So press ctrl+F12 and a new TaskWindow will open. The asterisk displayed is the prompt. Now we need to load the GPIO module for RiscOS and this is done with the RMLoad command. The example below assumes you have placed the GPIO folder you downloaded before in the top directory of your sdcard.
Code: Select all
To see if the module has been loaded and is working, open the GPIO folder you downloaded (the one on your sdcard) and run the !PiLed demo. A task window opens up and informs you about the selected GPIO pin mode. Press space to turn the activity (hdd status) LED of your Pi on, hit space again to turn it off.
To see BASIC code of the !PiLed program, hold down shift and left click the program icon and the application folder pops up. There is a BASIC file there called !RunImage. Again hold down shift and left click on the !RunImage file. This will open up an editor with the BASIC code. Enjoy reading.