added multiple games [broken]

This commit is contained in:
willem oldemans
2020-11-08 22:06:41 +01:00
parent a16ccf479d
commit 0123e4cc9f
20 changed files with 3951 additions and 73 deletions

47
src/buttons.h Normal file
View File

@@ -0,0 +1,47 @@
#ifndef BUTTONSH
#define BUTTONSH
#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 );
};
bool anybutton( void );
void initbuttons( void );
void handleButtons( void );
buttons* getButton(unsigned int index);
#endif //BUTTONSH