annotate py/setup_gpio.sh @ 292:28eb733cb803

60 second timeout
author Matt Johnston <matt@ucc.asn.au>
date Thu, 19 Mar 2015 21:50:52 +0800
parents d03157c7ad60
children 659953f2ee03
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
148
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
1 #!/bin/sh
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
2
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
3 # this must run as root
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
4
155
d03157c7ad60 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 148
diff changeset
5 PINS="17 7 24 25"
148
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
6 GROUP=fridgeio
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
7
155
d03157c7ad60 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 148
diff changeset
8 for PIN in $PINS; do
d03157c7ad60 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 148
diff changeset
9 echo $PIN > /sys/class/gpio/export
148
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
10
155
d03157c7ad60 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 148
diff changeset
11 for f in direction value; do
d03157c7ad60 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 148
diff changeset
12 fn=/sys/devices/virtual/gpio/gpio$PIN/$f
d03157c7ad60 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 148
diff changeset
13 chgrp $GROUP $fn
d03157c7ad60 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 148
diff changeset
14 chmod g+rw $fn
d03157c7ad60 rough touch sensor
Matt Johnston <matt@ucc.asn.au>
parents: 148
diff changeset
15 done
148
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
16 done