ht31 TEMPHUMI
HELLO; First time trying to set up a temp sensor. My sketch is an Adruino library . I received no instructions how to wire up the sensor so but I feel confident it's ok.
From the sensor I went Vcc-5v
Grnd-Grnd
SDA-4 Analog Pins
Scl-5
The monitor reads out: TEMP=nan C
HUM = nan %
I do not understand where " nan " is coming from
// Grove SHT31 Temp Humi Sensor - Version: Latest
#include <SHT31.h>
#include <Wire.h>
#include <Arduino.h>
//Grove SHT 31 Temp Humid Sensor
SHT31 sht31=SHT31();
void setup() {
Serial.begin(9600) ;
while(!Serial);
Serial.println("begin...");
sht31.begin();
}
void loop() {
float temp = sht31.getTemperature();
float hum = sht31.getHumidity();
Serial.print("Temp = ");
Serial.print(temp);
Serial.println(" C");
Serial.print("Hum = ");
Serial.print(hum);
Serial.println("%");
Serial.println();
delay(1000);
}