Mercurial > templog
diff py/setup_gpio.sh @ 155:d03157c7ad60
rough touch sensor
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 21 Dec 2012 23:30:16 +0800 |
parents | b32e5a11a4cb |
children | 659953f2ee03 |
line wrap: on
line diff
--- a/py/setup_gpio.sh Thu Dec 20 22:26:33 2012 +0800 +++ b/py/setup_gpio.sh Fri Dec 21 23:30:16 2012 +0800 @@ -2,13 +2,15 @@ # this must run as root -PIN=17 +PINS="17 7 24 25" GROUP=fridgeio -echo $PIN > /sys/class/gpio/export +for PIN in $PINS; do + echo $PIN > /sys/class/gpio/export -for f in direction value; do - fn=/sys/devices/virtual/gpio/gpio$PIN/$f - chgrp $GROUP $fn - chmod g+rw $fn + for f in direction value; do + fn=/sys/devices/virtual/gpio/gpio$PIN/$f + chgrp $GROUP $fn + chmod g+rw $fn + done done