16template <setting_t N,
class Callback = EmptySelectorCallback>
43 while (difference-- > 0)
46 while (difference++ < 0)
constexpr PinStatus_t LOW
constexpr PinStatus_t HIGH
constexpr PinMode_t INPUT_PULLUP
Wrap
An enumeration to set the behavior of selectors that are incremented (decremented) beyond their maxim...
@ Wrap
When the maximum (minimum) setting is reached, wrap around to the minimum (maximum) setting.
#define BEGIN_CS_NAMESPACE
std::enable_if< has_method_begin< T >::value >::type begin_if_possible(T &t)
Calls the begin() method of t if that method exists.
Class for reading quadrature encoders, heavily influenced by http://www.pjrc.com/teensy/td_libs_Encod...
int32_t read()
Read the current absolute position of the encoder.
Selector that reads from a rotary encoder.
EncoderSelector(Selectable< N > &selectable, const EncoderSwitchPinList &pins, int8_t pulsesPerStep=4, Wrap wrap=Wrap::Wrap)
void update() override
Update this updatable.
void begin() override
Initialize this updatable.
GenericEncoderSelector(Selectable< N > &selectable, const Callback &callback, const EncoderSwitchPinList &pins, int8_t pulsesPerStep=4, Wrap wrap=Wrap::Wrap)
void increment(Wrap wrap)
Add one to the setting, wrap around or clamp, depending on the parameter, if the new setting would be...
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
void begin() override
Initialize this updatable.
void reset()
Reset the selection to the initial selection.
void pinMode(pin_t pin, PinMode_t mode)
An ExtIO version of the Arduino function.
PinStatus_t digitalRead(pin_t pin)
An ExtIO version of the Arduino function.
Type for storing pin numbers of Extended Input/Output elements.
A struct for the pins of a rotary (quadrature) encoder with a switch.