8 #ifndef NO_BUTTONSCOMMANDER 9 #ifndef NO_BUTTONSCOMMANDERPOTENTIOMETER 18 this->mini = inMinimum;
19 this->maxi = inMaximum;
21 this->moveAccuracy = inMoveAccuracy - 1;
22 if (this->moveAccuracy <= 0)
23 this->moveAccuracy = 1;
25 int val = analogRead(this->pin);
26 this->currentValue = map(val, 0, 1023, this->mini, this->maxi);
31 #ifdef COMMANDERS_DEBUG_MODE 33 Serial.println(F(
"This potentiometer have no ID defined : call begin() !"));
36 int val = analogRead(this->pin);
38 val = map(val, 0, 1023, this->mini, this->maxi);
40 if (val < this->currentValue - this->moveAccuracy || val > this->currentValue + this->moveAccuracy)
42 #ifdef COMMANDERS_DEBUG_MODE 43 Serial.print(F(
"Potentiometer new value : "));
44 Serial.println(val, DEC);
46 this->currentValue = val;
53 #ifdef COMMANDERS_PRINT_COMMANDERS 54 void ButtonsCommanderPotentiometer::printCommander()
56 Serial.print(F(
" Potentiometer - Pin:"));
57 Serial.print(this->pin);
58 Serial.print(F(
" / Mini: "));
59 Serial.print(this->mini);
60 Serial.print(F(
" / Maxi: "));
61 Serial.print(this->maxi);
62 Serial.print(F(
" / Accuracy: "));
63 Serial.println(this->moveAccuracy);
static unsigned long RaiseEvent(unsigned long inId, COMMANDERS_EVENT_TYPE inEvent = COMMANDERS_EVENT_MOVEPOSITIONID, int inData = 0)