Read 2 virtual buttons from the app into an esp8266

Hey there i am new in this topic and i want to change a relais with Blynk.
I want to can toggle it with a switch on the blynk app and a timer.

void loop
if(V1 == 1) || (V2 == 1) {
digitalWrite( 2 , HIGH )
digitalWrite( 2 , LOW )

You need to format any posted code… as per the directions…

Blynk - FTFC

Meanwhile your void loop() should only contain the basics like while you put your sensor/relay/etc. controls in separate functions… some with a timed loop using BlynkTimer as nessesary.

I recommend you read through the Documentation & Help Center and try out the examples in the Sketch Builder (all these links are also at the top of this page) to get a good understanding of how programming with Blynk works…


BLYNK_WRITE(V0)  // Button Widget in SWITCH mode 
  int value = param.asInt(); // Get value as integer
  digitalWrite( 2 , value );  // control GPIO with value