[SOLVED] RGB LED Flasher using blynk via Wifi

Someone please help me. I have to submit it by tomorrow and facing an error!

 #define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
    #include <ESP8266_SoftSer.h>
    #include <BlynkSimpleShieldEsp8266_SoftSer.h>
    #include <Blynk/BlynkApi.h>
    #include <BlynkApiArduino.h>

    // Set ESP8266 Serial object
    #include <SoftwareSerial.h>
    SoftwareSerial EspSerial(2, 3); // RX, TX

    ESP8266 wifi(EspSerial);

    // You should get Auth Token in the Blynk App.
    // Go to the Project Settings (nut icon).
    char auth[] = "a20b235cfa794f07981d050950fb4429";

    #define red 11
    #define green 10
    #define blue 9 

    void setup()
    {
      // Set console baud rate
      Serial.begin(9600);
      delay(10);
      // Set ESP8266 baud rate
      // 9600 is recommended for Software Serial
      EspSerial.begin(9600);
      delay(10);

      Blynk.begin(auth, wifi, "username", "password");  // wifi username and password
    }

    BLYNK_WRITE(V1) 
    {
      int x = param[0].asInt();
      
        while(x==1)
       {
        x = param.asInt();
        int i=0,j=0,k=0;
        analogWrite(red, 255);
        analogWrite(green, 255);
        analogWrite(blue, 255);
        
          for(int j=0;j<20;j++)
          {
           analogWrite(red, 0);
           analogWrite(green, 255);
           analogWrite(blue, 255);
           delay(100);
           analogWrite(red, 255);
           analogWrite(green, 0);
           analogWrite(blue, 255);
           delay(100);
           analogWrite(red, 255);
           analogWrite(green, 255);
           analogWrite(blue, 0);
           delay(100);
            x = param.asInt();
            if(x==0)
            break;
          }
        
        analogWrite(red, 255);
        analogWrite(green, 255);
        analogWrite(blue, 255);
        
        for(int z=0;z<10;z++)
        {
        for(i=0;i<=180;i++)
        {
                analogWrite(red, 180-i);
                delay(2);
        }
        analogWrite(red, 255);
        for(j=0;j<255;j++)
        {
                analogWrite(green, 255-j);
                 delay(2);
        }
        analogWrite(green, 255);
        for(k=0;k<255;k++)
        {
                analogWrite(blue, 255-k);
                 delay(2);
        }
        analogWrite(blue, 255);
         x = param.asInt();
         if(x==0)
         break;
         
        }
        
        analogWrite(red, 255);
        analogWrite(green, 255);
        analogWrite(blue, 255);
            for(int z=0;z<5;z++)
        {

        for(j=0;j<255;j++)
        {
                analogWrite(green, 255-j);
                 delay(20);
        }
        for(k=0;k<255;k++)
        {
                analogWrite(blue, 255-k);
                 delay(20);
        }
        
            for(i=0;i<=180;i++)
        {
                analogWrite(red, 180-i);
                delay(20);
        }
        analogWrite(red,180);
         x = param.asInt();
         if(x==0)
         break;
        }
       if(x==0)
       break;
      }
        analogWrite(red, 255);
        analogWrite(green, 255);
        analogWrite(blue, 255);
    }

    void loop()
    {
      Blynk.run();
    }

Error that I am facing is: In file included from C:\Program Files (x86)\Arduino\libraries\BlynkSimpleShieldEsp8266_SoftSer/BlynkSimpleShieldEsp8266_SoftSer.h:20:0,
from sketch_feb14a.ino:3:
C:\Program Files (x86)\Arduino\libraries\BlynkApiArduino/BlynkApiArduino.h:14:28: fatal error: Blynk/BlynkApi.h: No such file or directory
#include <Blynk/BlynkApi.h>
^
compilation terminated.
Error compiling.

Where did you get the sketch, what hardware are you using and why did you leave it so late to do your course work?

2 Likes

Arduino UNO
Esp8266-21
RGB LED
Blynk App

It’s supposed to be, “if you wait until the last minute it only takes a minute.” Maybe not always!

1 Like

I didn’t get the solution yet!
Please can anyone help me!

#include <ESP8266_SoftSer.h> 
#include <BlynkSimpleShieldEsp8266_SoftSer.h> 

What should I use instead of these please help me out. I am unable to find any solution. I will be very thankful to you!

All you need to do is look :wink:

Start with the >Sketch Builder< Also prominently shown at the top right of this page.

Pick your hardware, start at the top and work your way through the much more current examples.