within the initial testing phase i was using a Elegoo Uno R3 and the code i used for that as well as the electrical circuit worked perfectly. However, i now need to use the Portenta H7 Lite but when i replicate the code and circuit it doesn’t work on the Portenta H7 Lite.
When printing the code onto the Portenta H7 Lite and i run the code, this error message shows up
I am trying to code a sensirion CO2 sensor through the Portenta H7 Lite but no matter how many time i troubleshoot the problem never seems to be solved.
`#include <Wire.h>
#include "SensirionI2CScd4x.h"
SensirionI2CScd4x scd4x;
void setup() {
Serial.begin(9600);
Wire.begin();
scd4x.begin(Wire);
uint16_t error;
char errorMessage[256];
error = scd4x.startPeriodicMeasurement();
if (error) {
Serial.print("Error trying to execute startPeriodicMeasurement(): ");
errorToString(error, errorMessage, 256);
Serial.println(errorMessage);
} else {
Serial.println("SCD41 periodic measurement started.");
}
}
void loop() {
uint16_t error;
char errorMessage[256];
uint16_t co2;
float temperature, humidity;
error = scd4x.readMeasurement(co2, temperature, humidity);
if (error) {
Serial.print("Error trying to execute readMeasurement(): ");
errorToString(error, errorMessage, 256);
Serial.println(errorMessage);
} else {
Serial.print("CO2(ppm): ");
Serial.print(co2);
Serial.print("t");
Serial.print("Temperature(C): ");
Serial.print(temperature);
Serial.print("t");
Serial.print("Humidity(%RH): ");
Serial.println(humidity);
}
delay(2000);
}`
Dylan Nicholson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.