In this part of my project, I'm reading "raw" data from an IR sensor. It sends a HIGH whenever it's not detecting any IR signals. I of course am interested in making sure that the HIGH signals that the sensor sends are not false positives (due to noise, etc.).
I know that, in my case, the "IR barrier" is going to be cut for at least 1 second. So I'm thinking a way to accomplish my goal would be to take multiple back to back samples from the IR sensor after the first HIGH signal is detected—let's say 5 samples. If at least 4 out of 5 of those samples are HIGHs, then count the first HIGH signal as a "legitimate" HIGH.
What do y'all think of this method? Is there a more "efficient" way I can improve this?
When you post a question about some hardware, please include a link to the datasheet or product page for the hardware you are talking about. We cannot read minds, we can read datasheets...
MarkT:
When you post a question about some hardware, please include a link to the datasheet or product page for the hardware you are talking about. We cannot read minds, we can read datasheets...