Skip to content

Commit

Permalink
Update MCP23X08 to not use old lib
Browse files Browse the repository at this point in the history
  • Loading branch information
VIPQualityPost committed Feb 5, 2024
1 parent a058a7e commit 8d993f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ayab/solenoids.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/ayab/solenoids.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "board.h"
#include "encoders.h"
#include <Arduino.h>
#include <Adafruit_MCP23008.h>
#include <Adafruit_MCP23X08.h>
#include <Adafruit_MCP23X17.h>
#include <Wire.h>

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8d993f8

Please sign in to comment.