add buzzer script
This commit is contained in:
parent
c99ef5be8c
commit
84c896d48d
1 changed files with 20 additions and 0 deletions
20
buzzer.sh
Normal file
20
buzzer.sh
Normal file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
gpio=0
|
||||
|
||||
$(command -v gpio) mode IN $gpio
|
||||
|
||||
while true; do
|
||||
|
||||
buzzerstat="$($(command -v gpio) read $gpio)"
|
||||
|
||||
if [ "$buzzerstat" -eq 0 ]; then
|
||||
/home/pi/RandomVideo/RandomVideo.sh buzzer
|
||||
sleep 5
|
||||
|
||||
elif [ "$buzzerstat" -eq 1 ]; then
|
||||
sleep 0.1
|
||||
|
||||
fi
|
||||
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue