Two color led (011)
Two color LED module(011)
Introduction:
In this blog we discuss about Two color led....3mm Two color LED module KY-011 for Arduino, emits red and green light. we can adjust the amount of each color using PWM. This module is similar to KY-029.This module consist of a common cathode 3mm red/green LED and a 0Ω resistor, Since operating voltage is 2.0v ~2.5v you'll need to use limiting resistors to prevent burnout when connecting to the Arduino.
- Operating voltage - 2.0v to 2.5v
- current -10 MA
- diameter - 5mm
- Package Type - Diffusion
- color - Red and Green
- Beam Angle - 150
- Wavelength - 571nm +644nm
Things Required :
- Arduino
- Breadboard
- Jumper wire
- two color Led (011)
For on/off
int Red = 9;
int Green = 10;
void setup() {
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
}
void loop() {
digitalWrite(9,HIGH);
digitalWrite(10,LOW);
delay(2000);
digitalWrite(10,HIGH);
digitalWrite(9,LOW);
delay(2000);
}
For pwm
int Red =9;
int Green = 10;
int val;
void setup () {
pinMode (9, OUTPUT);
pinMode (10, OUTPUT);
}
void loop () {
for (val = 255; val> 0; val--)
{
analogWrite (10, val);
analogWrite (9, 255-val);
delay(15);
}
for (val = 0; val <255; val++)
{
analogWrite (10, val);
analogWrite (9, 255-val);
delay (15);
}
}
Comments
Post a Comment