8 #ifndef NO_BUTTONSCOMMANDER 9 #ifndef NO_BUTTONSCOMMANDERSWITCH 13 this->debounceDelay = 50;
14 this->lastSelectedPin = DP_INVALID;
19 this->Pin1 = Arduino_to_GPIO_pin(inPin1);
21 this->Pin2 = Arduino_to_GPIO_pin(inPin2);
24 pinMode2f(this->Pin1, INPUT_PULLUP);
25 pinMode2f(this->Pin2, INPUT_PULLUP);
30 if (this->Pin1 != DP_INVALID)
33 int reading = digitalRead2f(this->Pin1);
37 this->lastSelectedPin = this->Pin1;
43 reading = digitalRead2f(this->Pin2);
45 this->lastSelectedPin = this->Pin2;
49 this->lastButtonState = reading;
56 &this->debounceDelay, &this->lastSelectedPin,
57 &this->lastButtonState, &this->lastDebounceTime);
63 &this->debounceDelay, &this->lastSelectedPin,
64 &this->lastButtonState, &this->lastDebounceTime);
67 #ifdef COMMANDERS_PRINT_COMMANDERS 68 void ButtonsCommanderSwitchTwoPins::printCommander()
70 Serial.print(F(
" SwitchTwoPins Pin1: "));
71 Serial.print(GPIO_to_Arduino_pin(this->Pin1));
72 Serial.print(F(
" / Id1: "));
73 Serial.print(this->
Id);
74 Serial.print(F(
" / Pin2: "));
75 Serial.print(GPIO_to_Arduino_pin(this->Pin2));
76 Serial.print(F(
" / Id2: "));
77 Serial.print(this->Id2);
78 Serial.println(F(
""));
static unsigned long RaiseEvent(unsigned long inId, COMMANDERS_EVENT_TYPE inEvent = COMMANDERS_EVENT_MOVEPOSITIONID, int inData = 0)