You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Humidity and Temperature data is received correctly by Serial, but after a random number of minutes (2min to 10min) arduino hangs, and stops sending data.
I added the code the function to toggle the pin 13 led each time it sends data, it hangs too.
Arduino board: Arduino Nano Every
Arduino IDE version : 1.8.13
Code
#include <Arduino.h>
#include <Wire.h>
#include "Adafruit_SHT31.h"
Adafruit_SHT31 sht31 = Adafruit_SHT31();
const int led = 13;
void setup()
{
delay(100);
pinMode(led, OUTPUT);
Serial.begin(9600);
if (! sht31.begin(0x44))
{
Serial.println("Couldn't find SHT31");
while (1) delay(1);
}
}
void loop()
{
float t = sht31.readTemperature();
float h = sht31.readHumidity();
if (! isnan(t))
{
Serial.print("Temp *C = "); Serial.println(t);
}
else
{
Serial.println("Failed to read temperature");
}
if (! isnan(h))
{
Serial.print("Hum. % = "); Serial.println(h);
}
else
{
Serial.println("Failed to read humidity");
}
Serial.println();
digitalWrite(led, !digitalRead(led));
delay(1000);
}
The text was updated successfully, but these errors were encountered:
Humidity and Temperature data is received correctly by Serial, but after a random number of minutes (2min to 10min) arduino hangs, and stops sending data.
I added the code the function to toggle the pin 13 led each time it sends data, it hangs too.
Arduino board: Arduino Nano Every
Arduino IDE version : 1.8.13
Code
The text was updated successfully, but these errors were encountered: