add projection screen up/down script

py3
Level2 DoorBuzz 2015-07-22 00:47:16 +02:00
parent cb5a29d91f
commit 9e57c15fbe
2 changed files with 35 additions and 0 deletions

View File

@ -70,6 +70,10 @@ sudo sed -i 's/#\(watchdog-device\)/\1/
sudo service watchdog start
Note: projectionscreen.sh is a standalone program called remotely by pidor
because pidor knows the IP adress of the projector but doorbuzz has the RF remote connected.
The remote command works with ssh, so install pidor's root pub key into
~pi/.ssh/authorized_keys
todo
====
create a config file

31
projectionscreen.sh Executable file
View File

@ -0,0 +1,31 @@
STOPBUTTON=8
UPBUTTON=7
DOWNBUTTON=23
gpio -g mode $STOPBUTTON out
gpio -g mode $UPBUTTON out
gpio -g mode $DOWNBUTTON out
function rollstop() {
gpio -g write $STOPBUTTON 1
sleep 0.2
gpio -g write $STOPBUTTON 0
}
function rollup() {
gpio -g write $UPBUTTON 1
sleep 0.2
gpio -g write $UPBUTTON 0
}
function rolldown() {
gpio -g write $DOWNBUTTON 1
sleep 0.2
gpio -g write $DOWNBUTTON 0
}
logger "$0 action $1"
case "$1" in
up) rollup
;;
down) rolldown
;;
stop) rollstop
;;
esac