An RGB 5mm Common Cathode 4-Pin LED is a type of light-emitting diode that contains Red, Green, and Blue LED chips in one package. Here's a detailed explanation of what this means and how to use it:
Pinout (Typical, Flat Side Facing You)
From left to right with the flat side facing you:
To use the RGB LED:
int redPin = 9; int greenPin = 10; int bluePin = 11; void setup() { pinMode(redPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(bluePin, OUTPUT); } void loop() { analogWrite(redPin, 255); // Max brightness analogWrite(greenPin, 0); // Off analogWrite(bluePin, 0); // Off delay(1000); analogWrite(redPin, 0); analogWrite(greenPin, 255); delay(1000); analogWrite(bluePin, 255); delay(1000); }
Origin: China
Brand:- King Light