Commanders
Arduino buttons/bus library
ButtonsCommanderSwitchTwoPins.hpp
1
//-------------------------------------------------------------------
2
#ifndef __buttonsCommanderSwitchTwoPins_H__
3
#define __buttonsCommanderSwitchTwoPins_H__
4
//-------------------------------------------------------------------
5
6
#include <
Commanders.h
>
7
#ifndef NO_BUTTONSCOMMANDER
8
#ifndef NO_BUTTONSCOMMANDERSWITCH
9
25
class
ButtonsCommanderSwitchTwoPins
:
public
ButtonsCommanderButton
26
{
27
private
:
28
GPIO_pin_t Pin1;
29
GPIO_pin_t Pin2;
30
// unsigned long Id1; / use base id instead...
31
unsigned
long
Id2;
32
33
unsigned
long
debounceDelay;
// the debounce time; increase if the output flickers
34
35
byte lastButtonState1;
36
unsigned
long
lastDebounceTime1;
37
byte lastButtonState2;
38
unsigned
long
lastDebounceTime2;
39
40
public
:
42
ButtonsCommanderSwitchTwoPins
();
43
50
void
begin
(
unsigned
long
inId1,
int
inPin1,
unsigned
long
inId2,
int
inPin2);
53
void
beforeFirstLoop
();
55
unsigned
long
loop
();
57
inline
unsigned
long
GetId
(GPIO_pin_t inPin)
const
{
return
inPin == this->Pin1 ? this->
Id
: (inPin == this->Pin2 ? this->Id2 :
UNDEFINED_ID
); }
58
59
#ifdef COMMANDERS_PRINT_COMMANDERS
60
63
void
printCommander();
64
#endif
65
};
66
67
//-------------------------------------------------------------------
68
#endif
69
#endif
70
#endif
ButtonsCommanderSwitchTwoPins::GetId
unsigned long GetId(GPIO_pin_t inPin) const
Definition:
ButtonsCommanderSwitchTwoPins.hpp:57
ButtonsCommanderSwitchTwoPins::beforeFirstLoop
void beforeFirstLoop()
Definition:
ButtonsCommanderSwitchTwoPins.cpp:31
ButtonsCommanderSwitchTwoPins::begin
void begin(unsigned long inId1, int inPin1, unsigned long inId2, int inPin2)
Definition:
ButtonsCommanderSwitchTwoPins.cpp:16
ButtonsCommanderSwitchTwoPins::ButtonsCommanderSwitchTwoPins
ButtonsCommanderSwitchTwoPins()
Definition:
ButtonsCommanderSwitchTwoPins.cpp:11
UNDEFINED_ID
#define UNDEFINED_ID
Definition:
Events.h:38
ButtonsCommanderSwitchTwoPins::loop
unsigned long loop()
Definition:
ButtonsCommanderSwitchTwoPins.cpp:53
ButtonsCommanderButton
Definition:
ButtonsCommanderButton.hpp:15
ButtonsCommanderSwitchTwoPins
Definition:
ButtonsCommanderSwitchTwoPins.hpp:25
ButtonsCommanderButton::Id
unsigned long Id
Definition:
ButtonsCommanderButton.hpp:19
Commanders.h
src
ButtonsCommanderSwitchTwoPins.hpp
Generated on ven. juil. 13 2018 22:02:23 for Commanders by
1.2.10