Files
embedded-labs/include/drivers/ButtonController.h
2025-04-28 18:30:29 +03:00

21 lines
417 B
C++

#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