Changed to JC_button lib
This commit is contained in:
@@ -3,45 +3,11 @@
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <vector>
|
||||
|
||||
|
||||
typedef enum buttonState_e
|
||||
{
|
||||
RELEASED,
|
||||
SHORT,
|
||||
LONG,
|
||||
INVALID
|
||||
}buttonState_t;
|
||||
|
||||
class buttons
|
||||
{
|
||||
const unsigned int _buttonIndex;
|
||||
const uint32_t _buttonPin;
|
||||
|
||||
unsigned long _buttonTimer;
|
||||
buttonState_t _buttonState;
|
||||
buttonState_t _lastState;
|
||||
bool _buttonFlag;
|
||||
unsigned long _buttonDelayShort;
|
||||
unsigned long _buttonDelayLong;
|
||||
|
||||
public:
|
||||
buttons(uint32_t pin, unsigned long shortpress, unsigned long longpress, unsigned int index);
|
||||
|
||||
void begin();
|
||||
|
||||
void update( void );
|
||||
|
||||
bool raw( void );
|
||||
|
||||
buttonState_t state();
|
||||
buttonState_t lastState();
|
||||
unsigned int index( void );
|
||||
};
|
||||
#include "JC_Button.h"
|
||||
|
||||
bool anybutton( void );
|
||||
void initbuttons( void );
|
||||
void initButtons( void );
|
||||
void handleButtons( void );
|
||||
buttons* getButton(unsigned int index);
|
||||
ToggleButton* getButton(unsigned int index);
|
||||
|
||||
#endif //BUTTONSH
|
||||
Reference in New Issue
Block a user