There is an ambiguous call coming from this library. It calls with a u_int32_t argument for which there is no corresponding overoad in function “requestFrom” in the Wire library. Can you fix this?
Here is my program, I’m using PlatformIO:
#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_I2CDevice.h>
#include <Adafruit_I2CRegister.h>
#include “Adafruit_MCP9600.h”
#define I2C_ADDRESS (0x67)
Adafruit_MCP9600 mcp;
void setup()
{
Serial.begin(115200);
while (!Serial) {
delay(10);
}
Serial.println("MCP9600 HW test");
/* Initialise the driver with I2C_ADDRESS and the default I2C bus. */
if (! mcp.begin(I2C_ADDRESS)) {
Serial.println("Sensor not found. Check wiring!");
while (1);
}
Serial.println(“Found MCP9600!”);
mcp.setADCresolution(MCP9600_ADCRESOLUTION_18);
Serial.print("ADC resolution set to ");
switch (mcp.getADCresolution()) {
case MCP9600_ADCRESOLUTION_18: Serial.print("18"); break;
case MCP9600_ADCRESOLUTION_16: Serial.print("16"); break;
case MCP9600_ADCRESOLUTION_14: Serial.print("14"); break;
case MCP9600_ADCRESOLUTION_12: Serial.print("12"); break;
}
Serial.println(" bits");
mcp.setThermocoupleType(MCP9600_TYPE_K);
Serial.print("Thermocouple type set to ");
switch (mcp.getThermocoupleType()) {
case MCP9600_TYPE_K: Serial.print("K"); break;
case MCP9600_TYPE_J: Serial.print("J"); break;
case MCP9600_TYPE_T: Serial.print("T"); break;
case MCP9600_TYPE_N: Serial.print("N"); break;
case MCP9600_TYPE_S: Serial.print("S"); break;
case MCP9600_TYPE_E: Serial.print("E"); break;
case MCP9600_TYPE_B: Serial.print("B"); break;
case MCP9600_TYPE_R: Serial.print("R"); break;
}
Serial.println(" type");
mcp.setFilterCoefficient(3);
Serial.print("Filter coefficient value set to: ");
Serial.println(mcp.getFilterCoefficient());
mcp.setAlertTemperature(1, 30);
Serial.print("Alert #1 temperature set to ");
Serial.println(mcp.getAlertTemperature(1));
mcp.configureAlert(1, true, true); // alert 1 enabled, rising temp
mcp.enable(true);
Serial.println(F("------------------------------"));
}
void loop()
{
Serial.print("Hot Junction: "); Serial.println(mcp.readThermocouple());
Serial.print("Cold Junction: "); Serial.println(mcp.readAmbient());
Serial.print(“ADC: “); Serial.print(mcp.readADC() * 2); Serial.println(” uV”);
delay(1000);
}