Commanders
Arduino buttons/bus library
ButtonsCommanderAnalogPushesItem.hpp
1 //-------------------------------------------------------------------
2 #ifndef __buttonsCommanderAnalogPushesItem_H__
3 #define __buttonsCommanderAnalogPushesItem_H__
4 //-------------------------------------------------------------------
5 
6 #include <Commanders.h>
7 #ifndef NO_BUTTONSCOMMANDER
8 #ifndef NO_BUTTONSCOMMANDERANALOGPUSHES
9 
13 {
14  private:
15  int analogValue; // analog value associated with this button
16  int readingTolerancy;
17 
18  public:
22  ButtonsCommanderAnalogPushesItem(unsigned long inId = 0) : ButtonsCommanderButton(inId) { this->analogValue = 0; }
23 
29  void begin(unsigned long inId, int inAnalogValue, int inTolerancy) { this->Id = inId; this->analogValue = inAnalogValue; this->readingTolerancy = inTolerancy; }
34  bool IsPushed(int inCurrentValue);
36  inline int GetAnalogValue() { return this->analogValue; }
37 
38 #ifdef COMMANDERS_PRINT_COMMANDERS
39 
42  void printCommander();
43 #endif
44 };
45 
46 //-------------------------------------------------------------------
47 #endif
48 #endif
49 #endif
int GetAnalogValue()
Definition: ButtonsCommanderAnalogPushesItem.hpp:36
bool IsPushed(int inCurrentValue)
Definition: ButtonsCommanderAnalogPushesItem.cpp:11
unsigned long Id
Definition: ButtonsCommanderButton.hpp:19
void begin(unsigned long inId, int inAnalogValue, int inTolerancy)
Definition: ButtonsCommanderAnalogPushesItem.hpp:29
Definition: ButtonsCommanderButton.hpp:15
Definition: ButtonsCommanderAnalogPushesItem.hpp:12
ButtonsCommanderAnalogPushesItem(unsigned long inId = 0)
Definition: ButtonsCommanderAnalogPushesItem.hpp:22