hi everyone. i need a help for my new project. it's quite simply but i don't know how to make it works fine...
Arduino make a digitalRead on pin2 and if there's a high level (1) it increment a variable (variable++;). the problem is that if the button continue to be pressed, the sketch continue to increment the variable.
is something about the coin counter... there's a method to read only the pulse signal (switched by a pushbutton) with not continue reading the state during the same pressure?
hope i was clear and thanks in advance for your help!
Valerio.
ok, i've tried but there is a problem, if i leave the button pressed it continue reading (and adding)... it shouldn't do!
i need a sketch that count only one time for pressure and stop reading after the button will be realized and pressed again!
Thanks again guys!
@Patouf, scusmy, i've tried incorrectly, THE SKETCH WORKS perfectly for me! thanks to everyone! (i've tried to edit my message but i'had lost my internet connection!)
so, problem solved, it JUST counts the pressure even if u leave the button pressed for some time after the push!