Commanders
Arduino buttons/bus library
ButtonsCommanderSwitchOnePin.hpp
1 //-------------------------------------------------------------------
2 #ifndef __buttonsCommanderSwitchOnePin_H__
3 #define __buttonsCommanderSwitchOnePin_H__
4 //-------------------------------------------------------------------
5 
6 #include <Commanders.h>
7 #ifndef NO_BUTTONSCOMMANDER
8 #ifndef NO_BUTTONSCOMMANDERSWITCH
9 
21 {
22  private:
23  GPIO_pin_t Pin;
24  unsigned long debounceDelay; // the debounce time; increase if the output flickers
25  GPIO_pin_t lastSelectedPin;
26 
27  int lastButtonState; // the previous reading from the current input pin
28  unsigned long lastDebounceTime; // the last time the current output pin was toggled
29 
30 public:
33 
38  void begin(unsigned long inId, int inPin);
41  void beforeFirstLoop();
43  unsigned long loop();
44 
45 #ifdef COMMANDERS_PRINT_COMMANDERS
46 
49  void printCommander();
50 #endif
51 };
52 
53 //-------------------------------------------------------------------
54 #endif
55 #endif
56 #endif
void begin(unsigned long inId, int inPin)