MCPcopy Create free account
hub / github.com/OpenEarable/open-earable / Button

Class Button

src/button_service/Button.h:13–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11};
12
13class Button {
14public:
15 Button(int pin);
16
17 void begin();
18 void end();
19
20 void inverted(bool _inverted = true);
21
22 ButtonState getState() const;
23
24 void setDebounceTime(unsigned long debounceTime);
25
26private:
27 int _pin;
28 bool _inverted = false;
29 unsigned long _lastDebounceTime;
30 unsigned long _pressStartTime;
31 unsigned long _debounceDelay = 25;
32
33 ButtonState _buttonState = RELEASED;
34
35 void _read_state();
36 static void _earable_btn_read_state();
37};
38
39extern Button earable_btn;
40

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected