Toll-Free Customer Support 24/7

Expansion Board

/*
* Project name:
Expansion Board--ALL LED BLINK
* Copyright
(c) Researchdesignlab.com
* Test configuration:
BOARD: RASPBERRY PI & BEAGLEBONE
Software: ECLIPSE

*/

 

#PROJECT NAME:ALL LED BLINK
#PROJECT LANGUAGE:SHELL SCRIPT
#COPYRIGHT:RESEARCH DESIGN LAB(C)

echo 4 > /sys/class/gpio/export
echo 17 > /sys/class/gpio/export
echo 22 > /sys/class/gpio/export
echo 25 > /sys/class/gpio/export
echo 24 > /sys/class/gpio/export
echo 23 > /sys/class/gpio/export
echo 18 > /sys/class/gpio/export
echo 27 > /sys/class/gpio/export

echo out > /sys/class/gpio/gpio4/direction
echo out > /sys/class/gpio/gpio17/direction
echo out > /sys/class/gpio/gpio22/direction
echo out > /sys/class/gpio/gpio25/direction
echo out > /sys/class/gpio/gpio24/direction
echo out > /sys/class/gpio/gpio23/direction
echo out > /sys/class/gpio/gpio18/direction
echo out > /sys/class/gpio/gpio27/direction

while [ 1 ]
do
echo 0 > /sys/class/gpio/gpio4/value
echo 0 > /sys/class/gpio/gpio17/value
echo 0 > /sys/class/gpio/gpio22/value
echo 0 > /sys/class/gpio/gpio25/value
echo 0 > /sys/class/gpio/gpio24/value
echo 0 > /sys/class/gpio/gpio23/value
echo 0 > /sys/class/gpio/gpio18/value
echo 0 > /sys/class/gpio/gpio27/value

sleep 2

echo 1 > /sys/class/gpio/gpio4/value
echo 1 > /sys/class/gpio/gpio17/value
echo 1 > /sys/class/gpio/gpio22/value
echo 1 > /sys/class/gpio/gpio25/value
echo 1 > /sys/class/gpio/gpio24/value
echo 1 > /sys/class/gpio/gpio23/value
echo 1 > /sys/class/gpio/gpio18/value
echo 1 > /sys/class/gpio/gpio27/value

sleep 2
done

Back to top