comparison 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
comparison
equal deleted inserted replaced
154:542efb356e46 155:d03157c7ad60
1 #!/bin/sh 1 #!/bin/sh
2 2
3 # this must run as root 3 # this must run as root
4 4
5 PIN=17 5 PINS="17 7 24 25"
6 GROUP=fridgeio 6 GROUP=fridgeio
7 7
8 echo $PIN > /sys/class/gpio/export 8 for PIN in $PINS; do
9 echo $PIN > /sys/class/gpio/export
9 10
10 for f in direction value; do 11 for f in direction value; do
11 fn=/sys/devices/virtual/gpio/gpio$PIN/$f 12 fn=/sys/devices/virtual/gpio/gpio$PIN/$f
12 chgrp $GROUP $fn 13 chgrp $GROUP $fn
13 chmod g+rw $fn 14 chmod g+rw $fn
15 done
14 done 16 done