Blynk library function error.

Hello,

Im a beginner in Arduino and i just bought my Arduino UNO and the NodeMCU board and many other things online.

Im working on a NodeMCU project which is lighting a specific LED using a virtual button in an app called blynk,i

The blynk app has a library which you can control the app from.

When i verified the code it send out this error message:

a function-definition is not allowed here before '{' token

the error occured at a function the blynk library provided.

The function:

BLYNK_READ(V3)
{
  digitalWrite(green,HIGH)
  delay(2000);
  digitalWrite(green,LOW);
}

The whole code:

#define BLYNK_PRINT Serial
#include<ESP8266WiFi.h>
#include<BlynkSimpleEsp8266.h>
char auth[] = ": this is private information";
char ssid[] = "HUAWEI-E5172-6065";
char pass[] = "private as well";
#define red 1
#define yellow 2
#define green 3




void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
pinMode(red,OUTPUT);
pinMode(yellow,OUTPUT);
pinMode(green,OUTPUT);
}

void loop()
{
  Blynk.run();
BLYNK_READ(V1)
{
 digitalWrite(red,HIGH);
 delay(2000);
 digitalWrite(red,LOW);
}

BLYNK_READ(V2)
{
  digitalWrite(yellow,HIGH);
  delay(2000);
  digitalWrite(yellow,LOW);
}
BLYNK_READ(V3){

  digitalWrite(green,HIGH)
  delay(2000);
  digitalWrite(green,LOW);
}


  
}

So i want to know what does this error mean? :neutral_face:

(deleted)

That's not an error of the Blynk library. It's an error in your code. You've defined multiple functions inside your definition of the loop() function. That's not allowed.

(deleted)

Hello,

Thank you and others so much!

the digitalwrite() mistake was an accident.

I really suck at remembering those !

But you were Right :slight_smile:

i should've put the functions outside the loop.

(deleted)