first commit
This commit is contained in:
21
include/drivers/ButtonController.h
Normal file
21
include/drivers/ButtonController.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef BUTTON_CONTROLLER_H
|
||||
#define BUTTON_CONTROLLER_H
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
class ButtonController {
|
||||
private:
|
||||
const int _buttonPin;
|
||||
unsigned long _lastDebounceTime;
|
||||
unsigned long _debounceDelay;
|
||||
bool _lastButtonState;
|
||||
bool _buttonState;
|
||||
|
||||
public:
|
||||
ButtonController(int buttonPin, unsigned long debounceDelay = 50);
|
||||
bool wasOn();
|
||||
void tick();
|
||||
bool getState() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user