annotate py/setup_gpio.sh @ 529:5201f441bf4a

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