From: Scott Harris <scottrharris@gm...> - 2008-04-04 21:30:39
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.
If this isn't possible, what's my minimum energy path? I need CF (or
MMC for storing data and moving it to a PC), two serial ports, and a
few bits of I/O.
From: Dave Hylands <dhylands@gm...> - 2008-04-05 03:21:39
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