Sunday, January 15, 2012

Testing beagleboard GPIO

Note: Beagleboard C2 use 1.8V for the expansion socket. Do not use higher voltage it may break your processor.

We will use expansion pin 22 (GPIO 157, see Beagleboard reference manual). Connect positive pin of led (long leg) to this port, and then the negative pin led (short leg) to expansion pin 28.
Goto folder /sys/class/gpio/export. There shouldn't be a folder named gpio157.

We need to open the GPIO:
$ echo 157 > /sys/class/gpio/export

Then set the gpio high
$ echo 1 > /sys/class/gpio157/value

or set the gpio low
$ echo 0 > /sys/class/gpio157/value

Finally close the GPIO
$ echo 157 > /sys/class/gpio157/unexport


More reading: http://blog.makezine.com/2009/02/03/blinking-leds-with-the-beagle-board/

No comments:

Post a Comment