switch-controller: init empty class
This class is meant for controlling switch behaviour, such as button hold etc
This commit is contained in:
31
SwitchController/inc/SwitchController.h
Normal file
31
SwitchController/inc/SwitchController.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* SwitchController.h
|
||||
*
|
||||
* Created on: Oct 17, 2022
|
||||
* Author: tylen
|
||||
*/
|
||||
|
||||
#ifndef SWITCHCONTROLLER_H_
|
||||
#define SWITCHCONTROLLER_H_
|
||||
|
||||
#include "DigitalIoPin.h"
|
||||
#include "StateHandler.h"
|
||||
#include "Timer.h"
|
||||
|
||||
class SwitchController
|
||||
{
|
||||
public:
|
||||
SwitchController (DigitalIoPin *button, Timer *timer, StateHandler *handler);
|
||||
virtual ~SwitchController ();
|
||||
/** Listen to switch button
|
||||
*/
|
||||
void listen ();
|
||||
|
||||
private:
|
||||
DigitalIoPin *b;
|
||||
Timer *t;
|
||||
StateHandler *h;
|
||||
bool b_state;
|
||||
};
|
||||
|
||||
#endif /* SWITCHCONTROLLER_H_ */
|
||||
Reference in New Issue
Block a user