char auth[] = “118adf17f3ef4c7e992ce04b48cfe711”;
int led=9;
void setup()
{
// Set console baud rate
Serial.begin(9600);
delay(10);
// Set ESP8266 baud rate
// 9600 is recommended for Software Serial
mySerial.begin(9600);
delay(10);
Blynk.begin(auth, wifi, “Android”, “osama123”);
pinMode(led,OUTPUT);
}
void loop()
{
Blynk.run();
float sensor=analogRead(A0);
float volt=sensor*(85.0/341.0);
analogWrite(led,volt);
}
I can’t control the fading of the led while connected to blynk I think blynk.run is blocking it somehow
Of course it takes time… And it’s normal. you should think about other way around.
For example, call connect explicitly in setup(), so it gets connected before the loop.
I’m sorry ,I’m kinda new to blynk I would appreciate it if you show me how ? 
Glad you figured this out! 
Could you please post your solution here, so others could benefit?
int led=9;
void setup()
{
// Set console baud rate
Serial.begin(9600);
delay(10);
// Set ESP8266 baud rate
// 9600 is recommended for Software Serial
mySerial.begin(9600);
delay(10);
Blynk.begin(auth, wifi, "Android", "osama123");
pinMode(led,OUTPUT);
Blynk.connect(); // add this to make it work
}
void loop()
{
Blynk.run();
float sensor=analogRead(A0);
float volt=sensor*(85.0/341.0);
analogWrite(led,volt);
}
add Blynk.connect in the setup so that the application doesn’t interfere with the code
1 Like