SHARE
TWEET

binblog

a guest Oct 4th, 2008 1,038 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. LED=$1
  4. STATE=$2
  5.  
  6. case "$LED" in
  7.         "1")
  8.                 GPIO=6
  9.                 ;;
  10.         "2")
  11.                 GPIO=25
  12.                 ;;
  13.         "3")
  14.                 GPIO=27
  15.                 ;;
  16.         *)
  17.                 echo 'Usage: led <1/2/3> <on/off>'
  18.                 exit 1
  19.                 ;;
  20. esac
  21.  
  22. gpioctl -q -c $GPIO out iout
  23.  
  24. case "$STATE" in
  25.         "on")
  26.                 gpioctl -q $GPIO 1
  27.                 ;;
  28.         "off")
  29.                 gpioctl -q $GPIO 0
  30.                 ;;
  31.         *)
  32.                 echo 'Usage: led <1/2/3> <on/off>'
  33.                 exit 1
  34.                 ;;
  35. esac
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top