#ifndef BUTTON_CONTROLLER_H #define BUTTON_CONTROLLER_H #include 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