#pragma once #include "Arduino.h" extern "C" { #include "osapi.h" } // Human Interface Button class HIB { private: ETSTimer timer; unsigned long previousMillis; unsigned long longPressMsec; public: uint8_t pin; uint8_t initialState; uint8_t state; uint8_t debouncing; HIB(uint8_t pin, uint8_t initialState, unsigned long longPressMsec = 5000); void IRQ_handler(); void onButtonPressed(); void onButtonReleased(); void onLongButtonPressed(); void invertState(); };