Commanders
Arduino buttons/bus library
ButtonsCommanderAnalogPushesItem.cpp
1 /*************************************************************
2 project: <Commanders>
3 author: <Thierry PARIS>
4 description: <Item button from analog array of push buttons with debounce.>
5 *************************************************************/
6 
7 #include <Commanders.h>
8 #ifndef NO_BUTTONSCOMMANDER
9 #ifndef NO_BUTTONSCOMMANDERANALOGPUSHES
10 
12 {
13  if (inCurrentValue >= this->analogValue - this->readingTolerancy && inCurrentValue <= this->analogValue + this->readingTolerancy)
14  return true;
15 
16  return false;
17 }
18 
19 #ifdef COMMANDERS_PRINT_COMMANDERS
20 void ButtonsCommanderAnalogPushesItem::printCommander()
21 {
22  Serial.print(F("Push Id: "));
23  Serial.print(this->Id);
24  Serial.print(F(" / value: "));
25  Serial.println(this->analogValue);
26 }
27 #endif
28 #endif
29 #endif