I have a device that outputs an analog temporal alarm pattern when activated to indicate the alarm type. I've figured out how to safely couple that output to an Arduino input pin, but I'm (n00b here) not certain how to decode it.
For one alarm type, the signal is on(500 milliseconds), off(500 msec), on(500 msec), off (500 msec), on(500 msec), off(1500 msec), then repeating. The official definition is 3 pulses followed by a pause, repeated, without an official definition of the length of pulses or the length of the pause (those are my observed timings).
For the other alarm type, the signal is on(100 msec), off(100 msec), on(100 msec), off(100 msec), on(100 msec), off(100 msec), on(100 msec), off(5000 msec). The official definition is 4 pulses followed by a pause, repeated, without an official definition of the length of pulses or the length of the pause (those are my observed timings).
How would one differentiate the 3-pulse signal from the 4-pulse signal in an Arduino sketch?