Files
ESP32Marauder/esp32_marauder/Switches.h
2024-02-22 23:54:03 -05:00

35 lines
456 B
C++

#ifndef Switches_h
#define Switches_h
#include <Arduino.h>
class Switches {
private:
int pin;
uint32_t hold_lim;
uint32_t cur_hold;
uint32_t hold_init = millis();
bool isheld;
bool pullup;
bool pressed;
bool getButtonState();
public:
Switches();
Switches(int pin, uint32_t hold_lim, bool pullup);
int getPin();
bool getPullup();
bool justPressed();
bool justReleased();
bool isHeld();
};
#endif