Almacenar variable

Hola, hay alguna forma de almacenar una variable de tipo float en el servidor de blynk? Es para guardar datos de un sensor de corriente por si se corta la luz, asi puedo recuperar los datos. Muchas gracias.

Hi, have a look at the Blynk.sync() function . . .

cul
billd

Entonces si uso esta funcion me recupera los datos del servidor? Yo había intentado usarla pero no me funciono, puede ser que me falta incluir algún código extra?

BLYNK_CONNECTED() {
Blynk.syncAll();
}

First of all, you need to be writing the data that you want to recover to a virtual pin. Lets say V0…

Blynk.virtualWrite(V1,my_data_value);

Then, you need to have a callback function that will be triggered when the value of that virtual pin is changed from within the app. This callback will also trigger when you call Blynk.syncVirtual(V0);

BLYNK_WRITE(V0)
{
 my_data_value = param.asInt(); // get the value from the server and save it back to my_data_value 
}

You can then change your BLYNC_CONNECTED callback to this…

BLYNK_CONNECTED()
{
Blynk.syncVirtual(V0);
}

Pete.

Muchas gracias @PeteKnight y @Bill_Donnelly ya lo hice funcionar.

2 Likes