MIDI Control Surface library for Arduino
|
Go to the documentation of this file.
3 #if !defined(Encoder_h_) && !defined(IDE)
5 "The PJRC Encoder library should be included before the Control-Surface \
6 library. (#include <Encoder.h>)"
15 template <setting_t N,
class Callback = EmptySelectorCallback>
35 long currentPosition =
encoder.read();
40 while (difference-- > 0)
43 while (difference++ < 0)
77 template <setting_t N>
void pinMode(pin_t pin, uint8_t mode)
An ExtIO version of the Arduino function.
GenericEncoderSelector(Selectable< N > &selectable, const Callback &callback, const EncoderSwitchPinList &pins, int8_t pulsesPerStep=4, Wrap wrap=Wrap::Wrap)
void begin() override
Initialize this updatable.
int digitalRead(pin_t pin)
An ExtIO version of the Arduino function.
uint16_t pin_t
The type for Arduino pins (and ExtendedIOElement pins).
void update() override
Update this updatable.
#define BEGIN_CS_NAMESPACE
void increment(Wrap wrap)
Add one to the setting, wrap around or clamp, depending on the parameter, if the new setting would be...
void begin() override
Initialize this updatable.
Wrap
An enumeration to set the behavior of selectors that are incremented (decremented) beyond their maxim...
constexpr pin_t NO_PIN
A special pin number that indicates an unused or invalid pin.
Selector that reads from a rotary encoder.
void reset()
Reset the selection to the initial selection.
When the maximum (minimum) setting is reached, wrap around to the minimum (maximum) setting.
void decrement(Wrap wrap)
Subtract one from the setting, wrap around or clamp, depending on the parameter, if the new setting w...
void update() override
Update this updatable.
Selectable< N > & selectable
EncoderSelector(Selectable< N > &selectable, const EncoderSwitchPinList &pins, int8_t pulsesPerStep=4, Wrap wrap=Wrap::Wrap)
A struct for the pins of a rotary (quadrature) encoder with a switch.