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 ?

yes, possible. see example "statechangedetection":
http://arduino.cc/en/tutorial/buttonstatechange

specialy line:
code: [select]

  if (buttonstate != lastbuttonstate) {
   (...)


Arduino Forum > Using Arduino > Programming Questions > Simple Digital Reading ?


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support