[SLOVED] virtualWrite doesn't refresh after Button pressed

So the code does work, but as soon as I press a Button, the Label (V5) which I control with a virtualWrite command doesn’t refresh any more.
I need to run Blynk on the Arduino over USB.
The Idea is, that when I’m switching the Button (V1) on, the servo rotates from 0 to 90°.

#include <SPI.h>
#include <Servo.h>
#include <SoftwareSerial.h>
#include <BlynkSimpleStream>
#include <SimpleTimer.h>
SoftwareSerial DebugSerial(2, 3); 
#define BLYNK_PRINT DebugSerial

char auth[] = "xxxx";

Servo slight;
SimpleTimer timer;
int light=0;

light = param.asInt();
Serial.print("light value is: ");

void refresh()
Blynk.virtualWrite(V5, light); //with BLYNK_READ same problem

void setup()
Blynk.begin(Serial, auth);
timer.setInterval(1000, refresh);

void loop()

Format your code like below (copy paste this example)


Thank you, didn’t know how to format properly. And any solutions for my problem?

In your code what is “light”:

Where in your code light changed? Maybe it takes value from sensor,so you need digitalRead or analogRead…

the integer “light” saves the data from the switch (V1) from the app. It can be 0 or 90 “degrees”. (to control the servo later). Right now, the switch is the only input for “light”. Later on I need to implement another physical Button.
I don’t have any problems with the servo and no problems with the integer “light”. But it doesn’t refresh the Labelwidget in the app, after the first use of the Switch/Button. The rest continues working just fine.

You are trying to send this data over the same serial port as your USB-server connection, this will affect MCU/Blynk communication.

Indeed. That was the problem. Thx mate!