Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende Überarbeitung | |||
project:arduino-kickstarter-105 [20.11.2013 21:27] – paalsteek | project:arduino-kickstarter-105 [20.11.2013 21:27] (aktuell) – paalsteek | ||
---|---|---|---|
Zeile 36: | Zeile 36: | ||
// read the state of the switch into a local variable: | // read the state of the switch into a local variable: | ||
int reading = digitalRead(buttonPin); | int reading = digitalRead(buttonPin); | ||
+ | | ||
// check to see if you just pressed the button | // check to see if you just pressed the button | ||
// (i.e. the input went from LOW to HIGH), | // (i.e. the input went from LOW to HIGH), | ||
// long enough since the last press to ignore any noise: | // long enough since the last press to ignore any noise: | ||
+ | | ||
// If the switch changed, due to noise or pressing: | // If the switch changed, due to noise or pressing: | ||
if (reading != lastButtonState) { | if (reading != lastButtonState) { |