From 68483a8ae8109d907c9936c6c85fc8cb11175032 Mon Sep 17 00:00:00 2001 From: gfvalvo Date: Fri, 25 Dec 2020 11:42:15 -0500 Subject: [PATCH] Update CustomEncoder.ino --- examples/CustomEncoder/CustomEncoder.ino | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/examples/CustomEncoder/CustomEncoder.ino b/examples/CustomEncoder/CustomEncoder.ino index 3f7329f..8717c4b 100644 --- a/examples/CustomEncoder/CustomEncoder.ino +++ b/examples/CustomEncoder/CustomEncoder.ino @@ -10,11 +10,23 @@ class CustomEncoder : public NewEncoder { CustomEncoder(uint8_t aPin, uint8_t bPin, int16_t initalValue, uint8_t type = FULL_PULSE) : NewEncoder(aPin, bPin, INT16_MIN, INT16_MAX, initalValue, type) {} virtual ~CustomEncoder() {} + virtual void configure(uint8_t aPin, uint8_t bPin, int16_t minValue, int16_t maxValue, int16_t initalValue, uint8_t type = FULL_PULSE); + void configure(uint8_t aPin, uint8_t bPin, int16_t initalValue, uint8_t type = FULL_PULSE); protected: virtual void updateValue(uint8_t updatedState); }; +void CustomEncoder::configure(uint8_t aPin, uint8_t bPin, int16_t minValue, int16_t maxValue, int16_t initalValue, uint8_t type) { + (void) minValue; + (void) maxValue; + configure(aPin, bPin, initalValue, type); +} + +void CustomEncoder::configure(uint8_t aPin, uint8_t bPin, int16_t initalValue, uint8_t type) { + NewEncoder::configure(aPin, bPin, INT16_MIN, INT16_MAX, initalValue, type); +} + void CustomEncoder::updateValue(uint8_t updatedState) { if ((updatedState & DELTA_MASK) == INCREMENT_DELTA) { _currentValue += 3;