Hi, I'm new to the forum and this is my first post.
In order to quiet down the noise coming from an IR sensor, I would like to say something along the lines of :
if ( sensor < somevalue for .5 seconds){
do this thing
}
else {you get the point}
My problem is, I don't know how to put this into any form of code. All I ask is that you please don't flat out give the answer, but hint at it ... if that makes any sense. thank you in advance
helpme222:
Thanks for the replies, i think i get the millis () thing [will utilize soon] , but I was wondering why this doesn't seem to work :
if (sensor = active){
delay(someamountofseconds)
do the thing
}
else...
you test the state for an instant in time. Then, you do nothing for a long period of time. Do you expect that your sensor remains unchanged during the time when you delay()? No, certainly not.