I am using a Arduino Mega to read some reed switches. Sometimes the signal is floating for a short time, like 1~10 ms. The problem is the long wiring between the mega and the sensor (10meters). For now there is no better solution for the long wiring.
The solution must be in the code. I want to work with millis, because the program have other things to do in meanwhile. So if the signal stays high for example 100ms than happens something. if once in the 100ms the signals go to low, nothing happens. and the program start over with this 'polling'.
I was looking for any solution on the internet. The only tutorials are with buttons, so its necessary to release the button. My sensor stays high when some must go happen.
Can give someone me a little help with a basic code? Thanks in advance :)