File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ void Debouncer::pciHandleInterrupt(byte vect) {
59
59
// -- After pin change we have the opposite level, lets start the bouncing timespan.
60
60
this ->_state += 1 ;
61
61
this ->lastCallTimeMicros = micros ();
62
- this ->setPeriodMs ( this ->debounceDelayMs ) ;
62
+ this ->periodMicros = this ->debounceDelayMicros ;
63
63
}
64
64
}
65
65
}
Original file line number Diff line number Diff line change 29
29
30
30
#include < SoftTimer.h>
31
31
#include < DelayRun.h>
32
- // #include <PciListener.h>
33
- #include " ../PciManager/PciListener.h"
32
+ #include < PciListener.h>
33
+ // #include "../PciManager/PciListener.h"
34
34
#include < Arduino.h>
35
35
36
36
#define MODE_OPEN_ON_PUSH HIGH
42
42
#define STATE_ONOFF_BOUNCING 3
43
43
44
44
/* * We say that 50 milliseconds are enough for the signal to stabilize. */
45
- #define DEFAULT_DEBOUNCE_DELAY_MILLIS 50
45
+ #define DEFAULT_DEBOUNCE_DELAY_MICROS 50000
46
46
47
47
class Debouncer : public PciListener , public Task
48
48
{
@@ -69,8 +69,8 @@ class Debouncer : public PciListener, public Task
69
69
/* *
70
70
* Change the delay of the bouncing time-span. The default value is DEFAULT_DEBOUNCE_DELAY_MILLIS;
71
71
*/
72
- unsigned long debounceDelayMs = DEFAULT_DEBOUNCE_DELAY_MILLIS ;
73
- boolean setDebounceDelayMs (unsigned long debounceDelayMs) { this ->debounceDelayMs = debounceDelayMs; return true ; };
72
+ unsigned long debounceDelayMicros = DEFAULT_DEBOUNCE_DELAY_MICROS ;
73
+ boolean setDebounceDelayMs (unsigned long debounceDelayMs) { this ->debounceDelayMicros = debounceDelayMs * 1000 ; return true ; };
74
74
private:
75
75
int _pin;
76
76
int _onLevel;
You can’t perform that action at this time.
0 commit comments