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 update() override
Update this updatable.
constexpr pin_t NO_PIN
A special pin number that indicates an unused or invalid pin.
GenericEncoderSelector(Selectable< N > &selectable, const Callback &callback, const EncoderSwitchPinList &pins, int8_t pulsesPerStep=4, Wrap wrap=Wrap::Wrap)
void decrement(Wrap wrap)
Subtract one from the setting, wrap around or clamp, depending on the parameter, if the new setting w...
Selectable< N > & selectable
void pinMode(pin_t pin, uint8_t mode)
An ExtIO version of the Arduino function.
#define BEGIN_CS_NAMESPACE
EncoderSelector(Selectable< N > &selectable, const EncoderSwitchPinList &pins, int8_t pulsesPerStep=4, Wrap wrap=Wrap::Wrap)
void begin() override
Initialize this updatable.
Wrap
An enumeration to set the behavior of selectors that are incremented (decremented) beyond their maxim...
void update() override
Update this updatable.
void increment(Wrap wrap)
Add one to the setting, wrap around or clamp, depending on the parameter, if the new setting would be...
Selector that reads from a rotary encoder.
uint16_t pin_t
The type for Arduino pins (and ExtendedIOElement pins).
int digitalRead(pin_t pin)
An ExtIO version of the Arduino function.
When the maximum (minimum) setting is reached, wrap around to the minimum (maximum) setting.
void begin() override
Initialize this updatable.
void reset()
Reset the selection to the initial selection.
A struct for the pins of a rotary (quadrature) encoder with a switch.