File tree 1 file changed +5
-2
lines changed
build/shared/examples/02.Digital/Debounce
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 21
21
by Limor Fried
22
22
modified 28 Dec 2012
23
23
by Mike Walters
24
+ modified 30 Aug 2016
25
+ by Arturo Guadalupi
26
+
24
27
25
28
This example code is in the public domain.
26
29
@@ -39,8 +42,8 @@ int lastButtonState = LOW; // the previous reading from the input pin
39
42
40
43
// the following variables are long's because the time, measured in miliseconds,
41
44
// will quickly become a bigger number than can be stored in an int.
42
- long lastDebounceTime = 0 ; // the last time the output pin was toggled
43
- long debounceDelay = 50 ; // the debounce time; increase if the output flickers
45
+ unsigned long lastDebounceTime = 0 ; // the last time the output pin was toggled
46
+ unsigned long debounceDelay = 50 ; // the debounce time; increase if the output flickers
44
47
45
48
void setup () {
46
49
pinMode (buttonPin, INPUT);
You can’t perform that action at this time.
0 commit comments