The LilyPad RGB LED is a versatile and compact electronic component designed for wearable projects. It integrates a tri-color (Red, Green, Blue) LED with a built-in current-limiting resistor, making it ideal for adding colorful lighting effects to textiles and other materials. With the ability to be sewn into fabric using conductive thread, the LilyPad RGB LED is perfect for fashion designers, hobbyists, and educators looking to incorporate interactive and illuminated elements into their designs.
Pin Name | Description |
---|---|
+ | Power supply (3.0V to 5.5V) |
- | Ground |
R | Control pin for the red LED |
G | Control pin for the green LED |
B | Control pin for the blue LED |
// Define the RGB LED pins
const int redPin = 9; // R pin connected to digital pin 9
const int greenPin = 10; // G pin connected to digital pin 10
const int bluePin = 11; // B pin connected to digital pin 11
void setup() {
// Set the RGB LED pins as outputs
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void loop() {
// Set the color to purple
analogWrite(redPin, 255); // Set red brightness to maximum
analogWrite(greenPin, 0); // Turn off green
analogWrite(bluePin, 255); // Set blue brightness to maximum
delay(1000); // Wait for 1 second
// Set the color to yellow
analogWrite(redPin, 255); // Set red brightness to maximum
analogWrite(greenPin, 255); // Set green brightness to maximum
analogWrite(bluePin, 0); // Turn off blue
delay(1000); // Wait for 1 second
}
Q: Can I wash garments with the LilyPad RGB LED sewn in? A: It is not recommended to wash electronic components. Remove the component or protect it from water and moisture before washing.
Q: How many LilyPad RGB LEDs can I connect to a single microcontroller? A: The number depends on the number of available PWM pins on the microcontroller and the power supply's capacity. Ensure that the total current draw does not exceed the microcontroller's or power supply's limits.
Q: Can I use the LilyPad RGB LED with a battery? A: Yes, as long as the battery provides a voltage within the 3.0V to 5.5V range and can supply enough current for the desired number of LEDs.