8 #ifndef NO_BUTTONSCOMMANDER 9 #ifndef NO_BUTTONSCOMMANDERSWITCH 13 this->debounceDelay = 50;
14 this->Pin1 = DP_INVALID;
15 this->Pin2 = DP_INVALID;
20 this->Pin1 = Arduino_to_GPIO_pin(inPin1);
22 this->lastButtonState1 = HIGH;
23 this->lastDebounceTime1 = 0;
25 this->Pin2 = Arduino_to_GPIO_pin(inPin2);
27 this->lastButtonState2 = HIGH;
28 this->lastDebounceTime2 = 0;
30 pinMode2f(this->Pin1, INPUT_PULLUP);
31 pinMode2f(this->Pin2, INPUT_PULLUP);
36 if (this->Pin1 != DP_INVALID)
39 int reading = digitalRead2f(this->Pin1);
40 this->lastButtonState1 = reading;
49 reading = digitalRead2f(this->Pin2);
50 this->lastButtonState2 = reading;
60 Serial.println(F(
"1 changed !"));
62 if (changed ==
true && this->lastButtonState1 == LOW)
64 Serial.println(F(
"this->lastButtonState1 = LOW"));
72 Serial.println(F(
"2 changed !"));
74 if (changed ==
true && this->lastButtonState2 == LOW)
76 Serial.println(F(
"this->lastButtonState2 = LOW"));
85 #ifdef COMMANDERS_PRINT_COMMANDERS 86 void ButtonsCommanderSwitchTwoPins::printCommander()
88 Serial.print(F(
" SwitchTwoPins Pin1: "));
89 Serial.print(GPIO_to_Arduino_pin(this->Pin1));
90 Serial.print(F(
" / Id1: "));
91 Serial.print(this->
Id);
92 Serial.print(F(
" / Pin2: "));
93 Serial.print(GPIO_to_Arduino_pin(this->Pin2));
94 Serial.print(F(
" / Id2: "));
95 Serial.print(this->Id2);
96 Serial.print(F(
" / Debounce delay: "));
97 Serial.print(this->debounceDelay);
98 Serial.println(F(
""));
static unsigned long RaiseEvent(unsigned long inId, COMMANDERS_EVENT_TYPE inEvent = COMMANDERS_EVENT_MOVEPOSITIONID, int inData = 0)