Need help on working with variables on Blynk

Hi!
In my actual code, there exists a variable which increases randomly. I want to set a loop in the app (Like sending a notification when the value of the variable > 5) after Blynk reads the variable data. After searching, I can only find about the usage of sensor data. But I just can’t find about the usage of Variables. I’m using virtual pins because there is no option in the app to deal with variables. Is there any way we can relate Virtual pins with variables? Or is there any way without using Virtual Pins? Please help me out.(And sorry for my bad english)
Thank you!

In the examples that use sensor data, that data is stored in a variable and sent to Blynk to be displayed in the app.
Take the example of a temperature sensor sketch. You’d read the value from the sensor say every 5 seconds, store the result in a variable (maybe called ‘temp’) then push that value out to Blynk using a Blynk.virtualWrite(VPin,temp) command.

Exactly the same principal applies to other variables. You’ll see many examples of uptime in millis() or RSSI signal strength being sent to the app.

The only think you shouldn’t do is to send the value of the variable too frequently.

Pete.

You can use global or local variables just like any other platform. If you want the data restored when the app reopens / reconnects it is better to use virtual pins.

the vpin can be any kind of data.

I use defines like this so I can remember what pin I used for what.

#define vcount V24

you can then read or wite data to that pin with code like this

Blynk.virtualWrite(vcount, rowIndex);                                         //save the card count on the server on the vcount pin