Virtual pins

hey blynkers
i am using blynk app in sync with my arduino nano using esp8266 as a wifi shield.
currently i am using a servo with it to move the latch of my door up or down. as it is battery operated i want to minimize the current . so i have attached a tip122(Darlington Transistors) to gives power to the servo only when it’s needed. in my dashboard i am using a switch and analog slider to turn the servo on and to give the pwn signal to move the servo. i want to add a switch on my dashboard so that when it goes high the transistors turns on for some time and the the pwn signal is given and reverse the state when the switch goes low. please help me for the code. just tell me how to read the value of a virtual pin in the arduino ide triggered by the app

BLYNK_WRITE(Vx){    // x is the virtual pin number
     int somevariable =param.asInt();
    if(somevariable  == 1){
      // do something
       // do something different

Strange name to read a pin (WRITE) but that has been covered many times on the forum.
Datatype of virtual pins can also be Strings, floats etc (details in the docs).


what should i do now? i know nothing about programming

Remove the curly bracket so you have:

int var1 = param.asInt();

instead of int var1 =param.asInt(); }

also don’t use delays

@paval. So what do i use then. I need to have some time gap between the digital pins and the servo. I was able to fix this error but another one appeared. It says ‘param’ is not defined