Hi all, my problem is that while the button is pressed the arduino continues to count presses, so if the button is pressed for say four seconds the arduino might count 40 presses.
My setup looks like this, the button is actually a relay inside a "photosensor", the relay is closed, and input goes high, when someone passes a sensor. I have installed this setup in a store with three sensors, one works fine but two others exhibit this problem. So when one person passes the arduino might count seven.
The sensors are not constructed by me, but they are all identically connected to the arduino.
The sensors are placed roughly 10-20 meters each from the arduino, the signals are transmitted through an unshielded cable, could this be the problem?