Go Down

Topic: compare sensor data range over time to shut off (Read 2221 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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy