take_pic.sh as used in hedgehog house to turn on IR LEDS before
taking a picture
This commit is contained in:
parent
b2a8c6de37
commit
cfd5faf9ed
24
raspberry_pi_IR_take_pic.sh
Executable file
24
raspberry_pi_IR_take_pic.sh
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
# take a picture.
|
||||||
|
# First turn on IR LEDS
|
||||||
|
# GPIO17 is tyhe ground side of the IR leds, so setting it to 0 turns them on
|
||||||
|
if [ -d /sys/class/gpio/gpio17 ]; then
|
||||||
|
echo " gpio17 already exists "
|
||||||
|
else
|
||||||
|
echo 17 > /sys/class/gpio/export
|
||||||
|
fi
|
||||||
|
|
||||||
|
sleep 0.1
|
||||||
|
# turn on the IR leds
|
||||||
|
echo out > /sys/class/gpio/gpio17/direction
|
||||||
|
echo 0 > /sys/class/gpio/gpio17/value
|
||||||
|
|
||||||
|
|
||||||
|
export d=`date`
|
||||||
|
export picname=`echo $d | sed 's/ /_/g' | sed 's/:/_/g' `
|
||||||
|
#echo $picname
|
||||||
|
|
||||||
|
libcamera-jpeg -o /home/robin/Pictures/$picname.jpg -t 2000 --width 1200 --height 1000
|
||||||
|
|
||||||
|
# turn off IR LEDS
|
||||||
|
echo 1 > /sys/class/gpio/gpio17/value
|
Loading…
Reference in New Issue
Block a user