July 04, 2012

Access General Purpose I/O port on FriendlyARM

    To access General Purpose I/O port on FriendlyARM, follow the procedure given below.


Open terminal on FriendlyARM:

cd sys/class/gpio                   // go to gpio
echo 36 > export                  // enable pin 36 of i/o port
echo out > gpio36/direction  // out for output. It makes pin 36 of I/O port as output pin
echo 1 > gpio36/value          // 1 for high, 0 for low
echo 36 > unexport              //disable

Check by using DMM or by LED. Output voltage should 3.3V

2 comments:

Anderson said...

Hi, my name is Anderson. I would like to know how access any GPIO in Java? I use the libfriendlyarm-hardware.so, but there are small quantity GPIO's (led's). I want to use, for example, the pushbutton. I want to use others I2C devices. I want to use others GPIO's (extension).

C. Towne Springer said...

What kernel are you using? This does not exists in the FriendlyARM kernel.