#include "ButtonsCommanderPotentiometer.hpp"
Public Member Functions | |
ButtonsCommanderPotentiometer () | |
int | GetPosition () const |
void | begin (unsigned long inId, int inPin, int inMinimum, int inMaximum, int inMoveAccuracy = 1) |
void | SetMiniMaxi (int inMini, int inMaxi, int inMoveAccuracy = 1) |
unsigned long | loop () |
![]() | |
ButtonsCommanderButton (unsigned long inId) | |
unsigned long | GetId () const |
virtual ButtonsCommanderButton * | GetFromId (unsigned long inId) |
virtual void | beforeFirstLoop () |
virtual void | EndLoop () |
void | SetNextButton (ButtonsCommanderButton *inpButton) |
ButtonsCommanderButton * | GetNextButton () const |
Additional Inherited Members | |
![]() | |
unsigned long | Id |
This class describes a potentiometer. This is an analog item, with a minimal, a maximal and a current analog value. An analog pin of the Arduino will return a value between 0 and 1023. The current value of this item will be mapped from 0/1023 to minimum/maximum current value. An event will be thrown when a change of the value will be greater than moveAccuracy.
Events thrown:
reason | id | type | data |
---|---|---|---|
value changed | button id | COMMANDERS_EVENT_MOVEPOSITION | value |
Definition at line 22 of file ButtonsCommanderPotentiometer.hpp.
ButtonsCommanderPotentiometer::ButtonsCommanderPotentiometer | ( | ) |
Default constructor.
Definition at line 11 of file ButtonsCommanderPotentiometer.cpp.
void ButtonsCommanderPotentiometer::begin | ( | unsigned long | inId, |
int | inPin, | ||
int | inMinimum, | ||
int | inMaximum, | ||
int | inMoveAccuracy = 1 |
||
) |
Initialize the instance.
inId | id of the button. |
inPin | Arduino analog pin connected to this potentiometer. |
inMinimum | minimum value, when the Arduino pin returns 0. |
inMaximum | maximum value, when the Arduino pin returns value of 1023. |
inMoveAccuracy | minimum change value to throw a new event. |
Definition at line 15 of file ButtonsCommanderPotentiometer.cpp.
|
inlinevirtual |
Gets the current value.
Reimplemented from ButtonsCommanderButton.
Definition at line 35 of file ButtonsCommanderPotentiometer.hpp.
|
virtual |
Main loop function.
Reimplemented from ButtonsCommanderButton.
Definition at line 30 of file ButtonsCommanderPotentiometer.cpp.
|
inline |
Change the mini/maxi values.
inMini | minimum value, when the Arduino pin returns 0. |
inMaxi | maximum value, when the Arduino pin returns value of 1023. |
inMoveAccuracy | minimum change value to throw a new event. |
Definition at line 50 of file ButtonsCommanderPotentiometer.hpp.