From 47e320c0fa775bf037a9f664ea008006da2db0e4 Mon Sep 17 00:00:00 2001 From: iothing Date: Mon, 20 Mar 2017 10:43:03 +0100 Subject: [PATCH] fixed bug that caused excessive heat (#67) * fixed bug that caused excessive heat * something besides the ir leds was still using current in the nightvision mode, was audible with the buildin mic :D --- data/usr/bin/fang-ir-control.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/data/usr/bin/fang-ir-control.sh b/data/usr/bin/fang-ir-control.sh index d5ddbd3..95881ef 100755 --- a/data/usr/bin/fang-ir-control.sh +++ b/data/usr/bin/fang-ir-control.sh @@ -2,10 +2,11 @@ echo "IR script started" # ir_init -gpio_ms1 -n 2 -m 1 -v 1 -gpio_aud write 1 1 0 -gpio_aud write 0 2 1 -gpio_aud write 1 0 0 +#gpio_ms1 -n 2 -m 1 -v 1 # this causes increased current flow +gpio_ms1 -n 2 -m 1 -v 0 # has something to do with the ir-cut/pass filter movement +gpio_aud write 1 1 0 # pin 1 is an output and is set to low, purpose unknown +gpio_aud write 0 2 1 # pin 2 is an input, the photoresistor +gpio_aud write 1 0 0 # pin 0 is an output and set to low, these are the ir-leds sleep 3 @@ -19,8 +20,9 @@ do then if [ $IR_ON -eq 1 ] then - gpio_ms1 -n 2 -m 1 -v 1 - gpio_aud write 1 0 0 + gpio_ms1 -n 2 -m 1 -v 1 # filter movement enabled + gpio_aud write 1 0 0 # disable ir led and latch the filter in the correct position + gpio_ms1 -n 2 -m 1 -v 0 # filter movement disabled echo 0x40 > /proc/isp/filter/saturation IR_ON=0 fi @@ -28,8 +30,10 @@ do if [ $IR_ON -eq 0 ] then echo 0x0 > /proc/isp/filter/saturation - gpio_aud write 1 0 1 - gpio_ms1 -n 2 -m 1 -v 0 + gpio_ms1 -n 2 -m 1 -v 0 # filter movement enabled + gpio_aud write 1 0 1 # enable ir led and latch the filter in the correct position + gpio_ms1 -n 2 -m 1 -v 1 # # filter movement disabled + echo 0x40 > /proc/isp/filter/saturation IR_ON=1 fi fi