Surilli
Published © LGPL

Interface an RGB LED with Surilli WiFi

Combine Red, Green & Blue in an RGB LED to produce over 16 million hues of light.

BeginnerFull instructions provided15 minutes481
Interface an RGB LED with Surilli WiFi

Things used in this project

Hardware components

RGB Diffused Common Anode
RGB Diffused Common Anode
×1
Surilli WiFi
Surilli WiFi
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Interface an RGB LED with Surilli WiFi

Code

RGB

C/C++
    int redValue = 0;
    int greenValue = 0;
    int blueValue = 0;
    int redPin= 4;
    int greenPin = 5;
    int bluePin = 2;
 void setup() {
     pinMode(redPin, OUTPUT);
     pinMode(greenPin, OUTPUT);
     pinMode(bluePin, OUTPUT);
   }
   void loop() {
    setColor(255, 255, 255); // White Color
    delay(1000);
    setColor(255, 255, 0); // Red Color
    delay(1000);
    setColor(255, 0, 0); // Red Color
    delay(1000);
    setColor(0, 255, 0); // Green Color
    delay(1000);
    setColor(0, 0, 255); // Blue Color
    delay(1000);
 }
   void setColor(int redValue, int greenValue, int blueValue) {
     analogWrite(redPin, redValue);
     analogWrite(greenPin, greenValue);
     analogWrite(bluePin, blueValue);
   }

Credits

Surilli

Surilli

196 projects • 62 followers
Surilli is a premiere Internet of Things centric Technology Company aimed at providing cutting edge innovative solutions.

Comments