Skip to content

Commit ae8a768

Browse files
authored
Add comments
1 parent f4d9ae1 commit ae8a768

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

take_photo.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@
55
echo "18" > /sys/class/gpio/export
66
echo "out" > /sys/class/gpio/gpio18/direction
77

8+
# Turn on the led connected to the pin 18 of the RPI
89
echo "1" > /sys/class/gpio/gpio18/value
910
sleep 2
1011
#Take a photo
1112
fswebcam -d v4l2:/dev/video0 -r 640x480 -D 10 -F 100 -S 50 --no-banner /home/alarm/img/$(date +\%Y\%m\%d\%H\%M).jpeg &> /home/alarm/log
1213

1314
sleep 2
15+
16+
# Turn of the led after the picture
1417
echo "0" > /sys/class/gpio/gpio18/value
18+
19+
# Workaround: The webcam stopes working after some time, if that happes we reboot the RPI
1520
string=`cat /home/alarm/log | grep "VIDIOC_STREAMON: Broken pipe"`
1621

1722
if [ ! -z "$string" ]; then

0 commit comments

Comments
 (0)