I am trying to use the freshly bought sensor running the full example from docs ( Shtc3 - Measuring temperature and humidity (examples) | Soldered Documentation ) on a fresh arduino R4 Wifi connected via qwiic. VCC + GND voltage measuring yields 3.3V.
but running the linked code, it returns only
Hum: 0.00
Temp: -45.00
Hello tee,
The Wire1 object can be forwarded to the shtc3 constructor, which then uses said i2c interface, here is an example of its usage for a simple read:
#include "SHTC3-SOLDERED.h"
SHTC3 shtcSensor(Wire1);
void setup()
{
shtcSensor.begin(); //Initialize sensor
Serial.begin(115200); //Start serial communication with PC using 115200 baudrate
}
void loop()
{
shtcSensor.sample(); //Initialize sensor
// For temperature use function readTempC
Serial.print("Temp: ");
Serial.println(shtcSensor.readTempC(), 2); //Get temperature and print
// For geting humidity use function readHumidity
Serial.print("Hum: ");
Serial.println(shtcSensor.readHumidity(), 2); //Get humidity and print
delay(5000);
}
With one line more (Wire1 has to be started) it is now working
Full working example:
#include "SHTC3-SOLDERED.h"
SHTC3 shtcSensor(Wire1);
void setup()
{
Wire1.begin();
shtcSensor.begin(); //Initialize sensor
Serial.begin(115200); //Start serial communication with PC using 115200 baudrate
}
void loop()
{
shtcSensor.sample(); //Initialize sensor
// For temperature use function readTempC
Serial.print("Temp: ");
Serial.println(shtcSensor.readTempC(), 2); //Get temperature and print
// For geting humidity use function readHumidity
Serial.print("Hum: ");
Serial.println(shtcSensor.readHumidity(), 2); //Get humidity and print
delay(5000);
}