I would like to produce an output after a constant input is detected for a certain amount of time. Below is a simple code of what I am trying to do minus the time factor. Can someone help me on how to code out the duration of an input occurrence? i.e.
if (sensorValue > threshold);
//if this occurs for more than 4 hours, then
digitalWrite (3, HIGH);