Hello,
I would like to make a thermometer that will show values through the application but for some reason still shows 0.
but when i try through the SHT31 example it works. does anyone know where the bug is?
thank you
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <SHT3x.h>
SHT3x Sensor;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "1489938d543349cf873c5487323c74d2";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "NETGEAR41";
char pass[] = "rapidapple717";
BlynkTimer timer;
// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void sendSensor()
{
float h = Sensor.GetTemperature();
float t = Sensor.GetRelHumidity(); // or dht.readTemperature(true) for Fahrenheit
Serial.println(h,t);
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V5, h);
Blynk.virtualWrite(V6, t);
}
void setup()
{
Sensor.Begin();
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,118), 8080);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
// Setup a function to be called every second
timer.setInterval(1000L, sendSensor);
}
void loop()
{
Blynk.run();
timer.run();