I need to set up an A/D converter which is unipolar, 8 bits , and 10 volts full scale. Max numeric value from ADC would be 2^8-1 or 255.
I need to compare the ADC value to 25 , if less nothing happens, if greater or equal to 25 for more than 5 seconds the ouputs are activated. If during the 5 second time period the value falls below 25 no alarms occur and timer is reset.It is ok to be above 25 as long as it doesn't stay there for more than 5 seconds in short...
I am hammering myself over how I'd write this function, any help would be appreciated.