BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Sending a temperature to blynk 2

Hi

I am having an issue sending a temperature (e.g. 15.5 ) to Blynk 2

I have set my Virtual data as decimal in Blynk.Console and then when I do a virtualWrite “Blynk.virtualWrite(V10,myValue)” and send the data as a float or int I get a zero in my Widgit (tried using Valued Label, Labeled value and also a Guage.)

I can get the data to display if I change the type to String in the virtual pin in the Console bit that seems wrong as I get no formatting etc… Am I doing something wrong?

Any help would be much appreciated

Ants

Set the datastream in the Web console to double.

Sorry my mistake - I said decimal in my initial msg but I should have typed “double” as decimal is not even an option. Any way it is set as double and still doesn’t work.

Thanks

Can you show me how did you configure your datastream please ?
And show me your sketch please.

#define BLYNK_TEMPLATE_ID "TMPLdw_jZT3W"
#define BLYNK_DEVICE_NAME "Map Data"
#define BLYNK_FIRMWARE_VERSION "0.1.0"
#define BLYNK_PRINT Serial

#define ONBOARD_LED 2
#include <BlynkEdgent.h>

bool ledToggle ;
float temperatureMin;
void setup() 
{
  Serial.begin(115200);
  pinMode(ONBOARD_LED,OUTPUT); 
  BlynkEdgent.begin();
  timer.setInterval(2000L,blynkTimerEvent);
}

void loop() 
{
    BlynkEdgent.run();    
    timer.run();
}

void blynkTimerEvent()
{ 
  float temperatureMin = 12.4;
  ledToggle = !ledToggle;
  digitalWrite(ONBOARD_LED,ledToggle);
  Blynk.virtualWrite(V8,ledToggle);  // prove that data is getting to blynk 
  Blynk.virtualWrite(V10,temperatureMin);
}

Your MAX value is 0 (zero) of datastream V10, change it to 100 (or higher)

That fixed it thankyou! Do you think I should add a request for a new feature that this should be mandatory.

No because it’s obvious, any blynk user knows that there must be min and max values, for example when you create a switch you have to put 0 and 1 or else it’s not gonna work.

@Ants default max value for DS is 1, so looks like you changed it to 0.