#include "ButtonsCommanderSwitchTwoPins.hpp"
A switch can be used in a A/B way, or A/Neutral/B. In this case only two Arduino pins are connected to the switch. The event raised is always of type COMMANDERS_EVENT_MOVE and data is COMMANDERS_MOVE_ON or COMMANDERS_MOVE_OFF, but the id used depends on the activated pin. The pins are independant, but probably when one is activated, the other is disactivated. In a case of a central/neutral position is available on the switch, none of the pins will be activated !
Events thrown:
ButtonsCommanderSwitchTwoPins::ButtonsCommanderSwitchTwoPins |
( |
| ) |
|
void ButtonsCommanderSwitchTwoPins::beforeFirstLoop |
( |
| ) |
|
|
virtual |
This function will be called after sketch Setup(), but before the first call to loop(). It will be called only one time.
Reimplemented from ButtonsCommanderButton.
void ButtonsCommanderSwitchTwoPins::begin |
( |
unsigned long |
inId1, |
|
|
int |
inPin1, |
|
|
unsigned long |
inId2, |
|
|
int |
inPin2 |
|
) |
| |
Initialize the instance.
- Parameters
-
inId1 | id of the first position. |
inPin1 | Arduino pin connected to the switch button for the first position. |
inId2 | id of the second position. |
inPin2 | Arduino pin connected to the switch button for the second position. |
unsigned long ButtonsCommanderSwitchTwoPins::GetId |
( |
GPIO_pin_t |
inPin | ) |
const |
|
inline |
Gets the right id according to the activated pin.
unsigned long ButtonsCommanderSwitchTwoPins::loop |
( |
| ) |
|
|
virtual |
The documentation for this class was generated from the following files:
- D:/Mes documents/Trusty/Arduino/Libraries/Commanders/src/ButtonsCommanderSwitchTwoPins.hpp
- D:/Mes documents/Trusty/Arduino/Libraries/Commanders/src/ButtonsCommanderSwitchTwoPins.cpp