Sunday, November 8, 2015

Basic input/output gpio pin GL-INET








1. Export first the gpio pin (example port 21), type command

echo "21" >/sys/class/gpio/export

2. Define gpio port 21 (example as output)

echo "out" >/sys/class/gpio//gpio21/direction

if as input type,

echo "in" >/sys/class/gpio//gpio21/direction



3. Fire up the led on gpio port 21

echo "1" >/sys/class/gpio/gpio21/value


No comments: