Introduction
The KY-011 2-color led is a handy littel component that allows two colors ( Red and Green) in a single LED while only having 3 pins
- Comman cathode pin
- Anode for green led
- Anode for red led
The KY-011 2-color led emits red and green colors but by applying different voltages on anodes of led we can produce different colors ,we will use PWM pin’s of our evive board to generate different voltages ,click here for more information on PWM
Circuit diagram
- Connect comman cathode pin of KY-011 module to ‘GND’ pin of evive
- Connect anode of green LED to pin number 10 of evive
- Connect anode of red LED to pin number 11 of evive
Arduino code
We have used two different ‘for’ loops in this code , first for loop will increase the intensity of “Red” led and second ‘for’ loop will increase the intensity of “Green” led