diff --git a/drivers/ioexpander/ioexpander.cpp b/drivers/ioexpander/ioexpander.cpp index dd98a1ea..ddf20c1c 100644 --- a/drivers/ioexpander/ioexpander.cpp +++ b/drivers/ioexpander/ioexpander.cpp @@ -366,7 +366,7 @@ namespace pimoroni { // Wait for a register to read its initialised value while(check_reset() != 0x78) { sleep_ms(1); - if(millis() - start_time >= timeout) { + if(millis() - start_time >= RESET_TIMEOUT_MS) { if(debug) printf("Timed out waiting for Reset!"); return false; diff --git a/drivers/ioexpander/ioexpander.hpp b/drivers/ioexpander/ioexpander.hpp index 3143ab38..88cb9e04 100644 --- a/drivers/ioexpander/ioexpander.hpp +++ b/drivers/ioexpander/ioexpander.hpp @@ -26,6 +26,8 @@ namespace pimoroni { static const uint8_t PIN_MODE_PWM = 0b00101; // PWM, Output, Push-Pull mode static const uint8_t PIN_MODE_ADC = 0b01010; // ADC, Input-only (high-impedance) + static const uint32_t RESET_TIMEOUT_MS = 1000; + public: static const uint8_t DEFAULT_I2C_ADDRESS = 0x18; diff --git a/libraries/breakout_encoder_wheel/breakout_encoder_wheel.hpp b/libraries/breakout_encoder_wheel/breakout_encoder_wheel.hpp index 378813ea..ecd229c9 100644 --- a/libraries/breakout_encoder_wheel/breakout_encoder_wheel.hpp +++ b/libraries/breakout_encoder_wheel/breakout_encoder_wheel.hpp @@ -27,8 +27,8 @@ namespace pimoroni { private: static const uint8_t ENC_CHANNEL = 1; - static const uint8_t ENC_TERM_A = 12; - static const uint8_t ENC_TERM_B = 3; + static const uint8_t ENC_TERM_A = 3; + static const uint8_t ENC_TERM_B = 12; static const uint8_t ENC_COUNTS_PER_REV = 24; static const uint8_t ENC_COUNT_DIVIDER = 2;