annotate py/setup_gpio.sh @ 452:25bdf95f0e29

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