From 8d993f89291da6c0598d3662d1aff553222d0292 Mon Sep 17 00:00:00 2001 From: matei jordache Date: Mon, 5 Feb 2024 17:42:13 -0500 Subject: [PATCH] Update MCP23X08 to not use old lib --- src/ayab/solenoids.cpp | 4 ++-- src/ayab/solenoids.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ayab/solenoids.cpp b/src/ayab/solenoids.cpp index cbc7b0ec..b7bb7f31 100644 --- a/src/ayab/solenoids.cpp +++ b/src/ayab/solenoids.cpp @@ -30,8 +30,8 @@ */ void Solenoids::init() { #ifdef HAS_MCP23008 - mcp_0.begin(I2Caddr_sol1_8); - mcp_1.begin(I2Caddr_sol9_16); + mcp_0.begin_I2C(I2Caddr_sol1_8); + mcp_1.begin_I2C(I2Caddr_sol9_16); for (uint8_t i = 0; i < SOLENOID_BUFFER_SIZE / 2; i++) { mcp_0.pinMode(i, OUTPUT); diff --git a/src/ayab/solenoids.h b/src/ayab/solenoids.h index 5a8aa062..74c148c7 100644 --- a/src/ayab/solenoids.h +++ b/src/ayab/solenoids.h @@ -27,7 +27,7 @@ #include "board.h" #include "encoders.h" #include -#include +#include #include #include @@ -86,8 +86,8 @@ class Solenoids : public SolenoidsInterface { void write(uint16_t state); #if defined(HAS_MCP23008) - Adafruit_MCP23008 mcp_0 = Adafruit_MCP23008(); - Adafruit_MCP23008 mcp_1 = Adafruit_MCP23008(); + Adafruit_MCP23X08 mcp_0 = Adafruit_MCP23X08(); + Adafruit_MCP23X08 mcp_1 = Adafruit_MCP23X08(); #elif defined(HAS_MCP23017) Adafruit_MCP23X17 mcp = Adafruit_MCP23X17(); #endif