#include "ButtonsCommanderEncoder.hpp"
This class describes a rotary encoder. A rotary or "shaft" encoder is an angular measuring device. It is used to precisely measure rotation of motors or to create wheel controllers (knobs) that can turn infinitely (with no end stop like a potentiometer has). Some of them are also equipped with a pushbutton when you press on the axis (like the ones used for navigation on many music controllers). In this case, only add a new ButtonsCommanderPush class instance beside the encoder. This class can handles also a current position, using the encoder like a potentiometer...
Events thrown:
ButtonsCommanderEncoder::ButtonsCommanderEncoder |
( |
| ) |
|
void ButtonsCommanderEncoder::begin |
( |
unsigned long |
inId, |
|
|
int |
inPin1, |
|
|
int |
inPin2, |
|
|
byte |
inMoveIncrement = 3 , |
|
|
int |
inStartingCurrentValue = 0 , |
|
|
int |
inMinimum = 0 , |
|
|
int |
inMaximum = 0 |
|
) |
| |
Initialize the instance. This encoder can be use like a potentiometer. To use this positional value, give a different value to minimum and maximum arguments.
- Parameters
-
inId | id of the button. |
inPin1 | Arduino pin connected to this encoder. |
inPin2 | Arduino pin connected to this encoder. |
inMoveIncrement | minimum change value to throw a new event. Default is 3, but it can depends of the material used. |
inStartingCurrentValue | In positional use, starting position. Must be between minimum and maximum ! Default is 0. |
inMinimum | minimum value in positional use, default is 0. |
inMaximum | maximum value in positional use, default is 0. |
int ButtonsCommanderEncoder::GetPosition |
( |
| ) |
const |
|
inlinevirtual |
unsigned long ButtonsCommanderEncoder::loop |
( |
| ) |
|
|
virtual |
void ButtonsCommanderEncoder::ResetStartingPosition |
( |
| ) |
|
|
inline |
Resets the current value of the positional mode to its starting value.
The documentation for this class was generated from the following files:
- D:/Mes documents/Trusty/Arduino/Libraries/Commanders/src/ButtonsCommanderEncoder.hpp
- D:/Mes documents/Trusty/Arduino/Libraries/Commanders/src/ButtonsCommanderEncoder.cpp