06-05-2018 10:06 PM - edited 06-05-2018 10:07 PM
Been trying to read a signal that should be high, but drops every 12s for about 20µs. I was able to read it some times, but not very consistently. The signal drops in one of the inputs and a few seconds later on the other. It is sort of a heartbeat, to indicate that the system is working.
In order to know that the device triggered, both inputs need to be low. So ignoring the heartbeat would be easy enough. However, would be nice to be able to know everything is working correctly. I wonder if there is an interrupt, a latching input on value change, etc.
The code I been testing is
#!/bin/sh while true; do in1="cat /proc/gpio/io18" in2="cat /proc/gpio/io19" in3=$(($in1 && $in2)) if [ $in1 = 0 ] && [ $in2 = 1 ] then echo "1 low" fi if [ $in1 = 1 ] && [ $in2 = 0 ] then echo "2 low" fi if [ $in1 = 0 ] && [ $in2 = 0 ] then echo "open" fi done