Go Down

Topic: compare sensor data range over time to shut off (Read 2040 times) previous topic - next topic

i want the led off if the sensor reading stays at same value for "x" amount of time. if not, then i want it to be high. thats all. i can't get this logic down

when the sensor data stays the same over a range of time, turn led off. when it doesn't, turn on

when the sensor stays a certain range for "x" amount of time, turn off. else, leave on.

Arrch


when the sensor stays a certain range for "x" amount of time, turn off. else, leave on.

So the only thing different about what you have and what you posted is you're are not looking for if the oldValue > newValue, you are looking for when they are not equal.

Go Up