Quote:
Originally Posted by Steve Dobler
How do you deal with the fact that the inputs are being pulsed on and off at around every 100ms? How does the program keep from repeating multiple times?
|
One method is to create a timer loop that runs every 100 msec that read's all four switches and saves the status. So, after 100 msec, the first thing inside the loop is to reset the timer to 0 and start again. Next, all four inputs are read and saved. 100 msec timer loop ends. Last, this routine can then be called whenever you want to determine the IR.
As long as 100 msec has expired since the last time you ran the loop, it should begin immediately.