Created
April 17, 2013 20:40
-
-
Save dwilkins/5407570 to your computer and use it in GitHub Desktop.
Shell Script that blinks an LED on pcDuino
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
modprobe gpio-sunxi | |
echo 3 > /sys/class/gpio/export | |
pindir=`ls -d /sys/class/gpio/gpio3*` | |
directionfile="${pindir}/direction" | |
valuefile="${pindir}/value" | |
echo "Direction file is ${directionfile}" | |
echo "Value file is ${valuefile}" | |
echo 'out' > ${directionfile} | |
for i in `seq 1 20` | |
do | |
echo "On" | |
sleep 1 | |
echo 1 > ${valuefile} | |
sleep 1 | |
echo "Off" | |
echo 0 > ${valuefile} | |
done | |
echo 3 > /sys/class/gpio/unexport | |
modprobe -r gpio-sunxi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment