Hello Blynkers ,
I am asking if there is a better attempt for FADE IN or FADE OUT .
This part of my sketch is working fine but I must have a least a delay of 300 ms.
is that correct ?
void Fade_IN(){ //fade in from min to max in increments of 20
Blynk.virtualWrite(vPIN_FADE_IN, 1);
for (double FadeValue = 0 ; FadeValue <= 1043.46; FadeValue += 20.46) {
analogWrite(LED_120, FadeValue);
delay(400); //wait for 400 ms to see the dimming effect
Blynk.virtualWrite(vPIN_LED,int (FadeValue/4));
terminal.println();
terminal.println();
terminal.println();
terminal.println("Manual MODE is ON");
terminal.println("Fade-IN in PROGRESS ");
terminal.print("Fade-IN = ");
terminal.print(FadeValue*100/1023);
terminal.println(" % ");
terminal.println();
terminal.println();
terminal.flush();
Blynk.virtualWrite(vPIN_STEP_V,FadeValue);
Blynk.virtualWrite(vPIN_SLIDER,FadeValue);
}
terminal.println("Fade-IN COMPLETED ");
terminal.print("Fade-IN = 100.00 ");
terminal.println(" % ");
terminal.println();
terminal.println();
terminal.flush();
Blynk.virtualWrite(vPIN_FADE_IN, 0);
}