Integrate Blynk

Hello

I am trying to modify a fading RGB led Arduino code and I was thinking to modify it to integrated it with Blynk but I don’t know a lot about arduino language. Can you provide me with the additional code? This is the code I found online.

Thank you

#define GREEN 3
 #define BLUE 5
 #define RED 6
 #define delayTime 20

 void setup() {

   pinMode(GREEN, OUTPUT);
   pinMode(BLUE, OUTPUT);
   pinMode(RED, OUTPUT);
   digitalWrite(GREEN, HIGH);
   digitalWrite(BLUE, HIGH);
   digitalWrite(RED, HIGH);
 }

 int redVal;
 int blueVal;
 int greenVal;
  
 void loop() {
  
   int redVal = 255;
   int blueVal = 0;
   int greenVal = 0;
   for( int i = 0 ; i < 255 ; i += 1 ){
     greenVal += 1;
     redVal -= 1;
     analogWrite( GREEN, 255 - greenVal );
     analogWrite( RED, 255 - redVal );

     delay( delayTime );
   }
  
   redVal = 0;
   blueVal = 0;
   greenVal = 255;
   for( int i = 0 ; i < 255 ; i += 1 ){
     blueVal += 1;
     greenVal -= 1;
     analogWrite( BLUE, 255 - blueVal );
     analogWrite( GREEN, 255 - greenVal );

     delay( delayTime );
   }
  
   redVal = 0;
   blueVal = 255;
   greenVal = 0;
   for( int i = 0 ; i < 255 ; i += 1 ){
     redVal += 1;
     blueVal -= 1;
     analogWrite( RED, 255 - redVal );
     analogWrite( BLUE, 255 - blueVal );

     delay( delayTime );
   }

Instead of asking for the working code it’s better to figure out how everything works.

Start small. Don’t use complex code. Try examples provided with Blynk library.

This is a super easy project. Set 3 sliders in the app and find out how to send slider values from the app to your hardware.

Docs here: Http://docs.blynk.cc