Virtual pin usage

i am facing the problem regarding declaration of the virtual pin.I don’t know how to declare it. whether we need to give value to the virtual pin in the code or not?? And if it is to give then how to give the values(minimum and maximum range ) for a guage widget ??
CODE:
‘’‘CPP
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#define trigPin 2
#define echoPin 4
#define buzzer 12
#define ssid “chandu”
#define password “162g1a04g5”
#define auth “,”
int t;
long distance;
void setup() {
Serial.begin(115200);
pinMode(trigPin,OUTPUT);
pinMode(echoPin,INPUT);
pinMode(buzzer,OUTPUT);
Blynk.begin(auth, ssid, password);
Blynk.virtualWrite(v0, distance);
}
void loop()
{
int t;
long duration,distance;
digitalWrite(trigPin,HIGH);
delayMicroseconds(500);
digitalWrite(trigPin,LOW);
duration = pulseIn(echoPin,HIGH);
distance = (duration/2)*34.3;
if(distance<5)
{
digitalWrite(buzzer,HIGH);
delay(500);
digitalWrite(buzzer,LOW);
}
if(distance>=6)
{
digitalWrite(buzzer,LOW);
}
if(t==500)
{
tone(12,20000,500);
}
else
{
noTone(12);
}
Serial.println(distance);
Blynk.run();
}
‘’’

The other problem you’re facing is that you didn’t read the instructions about how to post code correctly before deleting them.
Go back and edit your post with three backticks and cpp at the start, and three backticks at the end, as shown below…
Blynk - FTFC

I’d also remove your Auth code as well, for security reasons.

Pete.