Surilli
Published © LGPL

Interface an RGB LED with Surilli Basic M0

Combine red, green, and blue leds in an RGB LED to produce over 16 million hues of light.

BeginnerFull instructions provided15 minutes478
Interface an RGB LED with Surilli Basic M0

Things used in this project

Hardware components

RGB Diffused Common Anode
RGB Diffused Common Anode
×1
Surilli Basic
Surilli Basic
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Interface an RGB LED with Surilli Basic M0

Code

RGB

C/C++
    int redValue = 0;
    int greenValue = 0;
    int blueValue = 0;
    int redPin= A2;
    int greenPin = A1;
    int bluePin = A0;
 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