From 45e3e3d1855fa1da3e4151a64f10f33e61eab692 Mon Sep 17 00:00:00 2001 From: Neil McKechnie Date: Thu, 23 Feb 2023 20:17:15 +0000 Subject: [PATCH] Update IO_RotaryEncoder.h Update to support extended I2C addresses. --- IO_RotaryEncoder.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/IO_RotaryEncoder.h b/IO_RotaryEncoder.h index 9cf4e65..b271b48 100644 --- a/IO_RotaryEncoder.h +++ b/IO_RotaryEncoder.h @@ -45,14 +45,14 @@ class RotaryEncoder : public IODevice { public: // Constructor - RotaryEncoder(VPIN firstVpin, int nPins, uint8_t I2CAddress){ + RotaryEncoder(VPIN firstVpin, int nPins, I2CAddress i2cAddress){ _firstVpin = firstVpin; _nPins = nPins; - _I2CAddress = I2CAddress; + _I2CAddress = i2cAddress; addDevice(this); } - static void create(VPIN firstVpin, int nPins, uint8_t I2CAddress) { - if (checkNoOverlap(firstVpin, nPins, I2CAddress)) new RotaryEncoder(firstVpin, nPins, I2CAddress); + static void create(VPIN firstVpin, int nPins, I2CAddress i2cAddress) { + if (checkNoOverlap(firstVpin, nPins, i2cAddress)) new RotaryEncoder(firstVpin, nPins, i2cAddress); } private: @@ -108,7 +108,6 @@ private: (int)_firstVpin, _firstVpin+_nPins-1, (_deviceState==DEVSTATE_FAILED) ? F("OFFLINE") : F("")); } - uint8_t _I2CAddress; int8_t _position; int8_t _previousPosition = 0; uint8_t _versionBuffer[3];