Mercurial > templog
comparison py/setup_gpio.sh @ 454:dce9f7841696
rough touch sensor
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 21 Dec 2012 23:30:16 +0800 |
parents | 8fdf86ea41e7 |
children | 659953f2ee03 |
comparison
equal
deleted
inserted
replaced
453:0af7b38a1847 | 454:dce9f7841696 |
---|---|
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 |