One can display a certain color by mixing only three basic colors: Red, Green and Blue. Adding different levels of each color we get many colors.
If all colors are OFF, we get black, and if colors are fully ON, we get white. You can find many color mixing web sites to understand better and to play with different percentages of colors (for example: https://www.colortools.net/color_mixer.html).
2. RGB LED
An RGB LED is made of three LEDs: a red one, a blue one and a green one. Some RGB LEDs have the anode terminal (or "+" terminal) in common and some have the cathode terminal (or "-" terminal) in common.
The one we are going to use in our project is a Common Cathode RGB LED.
|Micro:bit pins||RGB LED pins|
|0||Red (via resistor)|
|1||Green (via resistor)|
|2||Blue (via resistor)|
Like with all LEDs we are going to use a resistor (220 Ohms, in our case) in series in order to limit the current, thus protecting the LED and the micro:bit.