mirror of https://github.com/noisymime/Arduino.git
small changes to the Debounce example
This commit is contained in:
parent
97e0f34572
commit
c87ddd567d
|
@ -22,7 +22,7 @@
|
|||
modified 28 Dec 2012
|
||||
by Mike Walters
|
||||
|
||||
This example code is in the public domain.
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Debounce
|
||||
*/
|
||||
|
@ -75,12 +75,12 @@ void loop() {
|
|||
// only toggle the LED if the new button state is HIGH
|
||||
if (buttonState == HIGH) {
|
||||
ledState = !ledState;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set the LED:
|
||||
digitalWrite(ledPin, ledState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// save the reading. Next time through the loop,
|
||||
// it'll be the lastButtonState:
|
||||
|
|
Loading…
Reference in New Issue