annotate py/setup_gpio.sh @ 148:b32e5a11a4cb

few updates, seems to run
author Matt Johnston <matt@ucc.asn.au>
date Sat, 15 Dec 2012 23:49:08 +0800
parents
children d03157c7ad60
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
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
5 PIN=17
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
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
8 echo $PIN > /sys/class/gpio/export
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
9
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
10 for f in direction value; do
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
11 fn=/sys/devices/virtual/gpio/gpio$PIN/$f
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
12 chgrp $GROUP $fn
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
13 chmod g+rw $fn
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
14 done