On Fri, Apr 4, 2008 at 2:30 PM, Scott Harris <scottrharris@...> wrote:
> I need a few bits of I/O. Is there way to achieve this with the 20
> pins on the console-st? I'd like to run a few LEDs and check the
> status of a few switches. Ideally, I'd like to do this via Python. My
> data rate required is very low.
Yeah - you can configure most of the pins to be GPIO pins.
For the switches, I recommend that you take a look at the gpio-event driver.
For outputs, you can modprobe the proc_gpio module and then just write
strings to the /proc/gpio/GPIO99 file (replace 99 with the GPIO
echo "GPIO out set" > /proc/gpio/GPIO61 would configure pin-61 (LDD03)
as a GPIO and set it high (3.3v).
echo "GPIO out clear" > /proc/gpio/GPIO61 will set it low.
So you can either use the system command, or you can open the file
/proc/gpio/GPIO61 from within Python and write the string "GPIO out
set\n" to it.
Vancouver, BC, Canada