Simple Digital Reading ?
hi everyone, have sketch below, simple digital read push button example .
however of course, program keep on scrolling down updating state of button every delay time set .
what want happen display reading moment push button ,
if hold still,, display 1 piece of "1" in serial monitor . , moment stop holding , display
only 1 "0" .
is possible ?
however of course, program keep on scrolling down updating state of button every delay time set .
what want happen display reading moment push button ,
if hold still,, display 1 piece of "1" in serial monitor . , moment stop holding , display
only 1 "0" .
is possible ?
yes, possible. see example "statechangedetection":
http://arduino.cc/en/tutorial/buttonstatechange
specialy line:
http://arduino.cc/en/tutorial/buttonstatechange
specialy line:
code: [select]
if (buttonstate != lastbuttonstate) {
(...)
Arduino Forum > Using Arduino > Programming Questions > Simple Digital Reading ?
arduino
Comments
Post a Comment