void Temperature()
{
//You can send any value at any time.
//Please don't send more that 10 values per second.
//Read the Temp and Humidity from DHT
float t = dht.readTemperature();
String rt = String(t,1);
int h = dht.readHumidity();
Blynk.virtualWrite(11, rt); // virtual pin
Blynk.virtualWrite(12, rt); // virtual pin
Blynk.virtualWrite(13, h); // virtual pin
Blynk.virtualWrite(14, h, "%"); // virtual pin
Serial.println(t);
// Please use timed events when LCD printintg in void loop to avoid sending too many commands
// It will cause a FLOOD Error, and connection will be dropped
}
With this code, I store the temperature in Celcius to a String “rt” while truncating its decimal value to 1. Refer to the attached pictures here…
The widgets,
- Value Display, and
- LCD Widget, reads data from the same Virtual Pin…
But as you can see, they’re both not the same…
Value Display truncates the decimal points, as intended
LCD Widget displays a different data altogether…
For example:
Value Display Widget shows, 17.8
LCD Widget shows, 17.799999
Also, the LCD Widget truncates the value near a whole number like “32”
Also, it truncates the value near “.5”, like “32.5”
Can we get this fixed in the next update?