Working on a project and really need some help with the code. Writing to a mega2560 using a sensor to turn on an led.
The problem is, I need the led to trigger only after the analog sensor has given a consecutive block of numbers. This sensor only gives 0s and 1s... So I need the led to trigger only if the sensor has read 1,1,1,1,1.... Not 1,0,0,1. I'm completely new and stumped on how to do this. It would also be great if I could adjust that consecutive block of numbers. Any help would be immensely appreciated.