binblog
By: a guest | Oct 4th, 2008 | Syntax:
Bash | Size: 0.63 KB | Hits: 782 | Expires: Never
#!/bin/sh
LED=$1
STATE=$2
case "$LED" in
"1")
GPIO=6
;;
"2")
GPIO=25
;;
"3")
GPIO=27
;;
*)
echo 'Usage: led <1/2/3> <on/off>'
exit 1
;;
esac
gpioctl -q -c $GPIO out iout
case "$STATE" in
"on")
gpioctl -q $GPIO 1
;;
"off")
gpioctl -q $GPIO 0
;;
*)
echo 'Usage: led <1/2/3> <on/off>'
exit 1
;;
esac