Hello,
I have an issue with a SHT31-D and wemos D1 mini pro. It's done for -40°C - +65°C.
I use the code below, but I have an issue when temperature is negative.
I got value : 42949672.0°C instead of negative value. For positive value, no problem !
Humidity is fine even temp is negative.
Do I miss something ? Is there any tips.
#include <Arduino.h>
#include <Wire.h>
#include "Adafruit_SHT31.h"
Adafruit_SHT31 sht31 = Adafruit_SHT31();
void setup() {
Serial.begin(9600);
while (!Serial)
delay(10); // will pause Zero, Leonardo, etc until serial console opens
Serial.println("SHT31 test");
if (! sht31.begin(0x44)) { // Set to 0x45 for alternate i2c addr
Serial.println("Couldn't find SHT31");
while (1) delay(1);
}
}
void loop() {
float t = sht31.readTemperature();
float h = sht31.readHumidity();
Serial.print("Temp *C = "); Serial.println(t);
Serial.print("Hum. % = "); Serial.println(h);
delay(1000);
}
thanks in advance