Hey guys, I need some help with writing a code for a bidirectional counter using the Uno R2 or 3.
The goal is to have 2 infrared detectors that give a HIGH output when triggered by motion. These HIGH outputs are fed to the arduino input pins and the time in which the detectors are triggered is recorded in real time. Since they'll be some time interval between the triggering of both detectors, the recorded times are compared and if the difference is positive, the 7 segment display connected to the ADC output of the Arduino increases by 1 If the difference is negative, it decreases by 1.
This is the best algorithm I came up with. If you have a better or easier method, I will be very glad to learn. I will really appreciate if someone can help with writing a source code for my counter. Thanks