Knowledge Base
...
Basics: Working With Hardware
LED - Light Emitting Diode

Dual Color LEDs

4min
lead in multi color leds look similar to the single color type, apart from the 3 or more pins instead of the two they are ideal for use as indicators if, for example, the system needs to indicate a change of state changing the color the dual color led is illuminated in the same way as a regular led power is applied to the anode with the anode connected to gnd or 0vdc a current limiting resister would be required as described in powering an led docid 4qvn9zmsglc 0 k44axs6 , with the exception that two resistors would be needed one for each led code sample the following code sample illustrates how a dual color led can be implemented device pic16f1827 | 1847 development board radix nano 18 \#define red portb b0 \#define green portb b1 void setup(){ ansela=0x00; anselb=0x00; trisb = 'b1111100; portb = 0x00; c1on bit = 0; // disable comparators c2on bit = 0; } void main(){ setup(); while(1){ red = 1; green = 0; delay ms(500); red = 0; green = 1; delay ms(500); } } other options rgb the rgb led can be used to produce different colors and is similar in principle to the led screen depending on the intensity of the various base colors, different colors can be produced lead out multi color leds are an interesting way to implement different colors using a few leds with intuitive programming, they can be used effectively in a system application