I want to use NodeMCU v3 with a MCP23017 that has a MAX6675 at the end. Everything is in the circuit; please see the image.
The MAX6675 (U3) doesn't want to work with the MCP23017.
First MAX6675 (U4) works perfectly fine using MAX6675 library
MAX6675 max(D5, D7, D6); max.readCelsius(); //gives proper temperature
For MCP23017 I'm using the Adafruit_MCP23017 library
I have tested the MCP23017 with simple code. The LED is blinking so I'm assuming that it is not broken.
Adafruit_MCP23017 mcp; mcp.begin(0); mcp.pinMode(0, OUTPUT); mcp.digitalWrite(0, HIGH); //LED lights up delay(1000); mcp.digitalWrite(0, LOW); //LED turns off delay(1000);
I slightly modified the MAX6675 lib to use adafruit_MCP23017 to digital Read/Write; here is my Github repo.
I'm trying to read the MAX6675 (U3) connected through the MCP23017 (U2) using this code:
Adafruit_MCP23017 mcp;
mcp.begin(0);
MAX6675_MCP max_mcp(mcp, 1, 2, 3);
Serial.print(max_mcp.readCelsius()); //displays 0 or NAN
Assuming:
U4 / U3 works connected straight to NodeMcu
MCP23017 works because of flashing LED
My question is: Why doesn't the MAX6675 (U3) want to work connected through the MCP23017 (U2)?
Where did I make a mistake?