annotate py/setup_gpio.sh @ 459:c34083c078db

uploader works
author Matt Johnston <matt@ucc.asn.au>
date Thu, 03 Jan 2013 22:37:33 +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