We will create a doorbell circuit using an active buzzer and an RGB LED. Since we have not discussed RGB LEDs before, we will take a quick look at this amazing little electronic component. We then write a simple test program, using our Raspberry Pi, that will light up the RGB LED and sound the active buzzer.
An RGB LED is really just three LEDs in one unit: a red one, a green one, and a blue one. Almost any color may be achieved by applying electric current at varying power levels across the selection of input pins. The following is a diagram of such an LED:
As you can see there are red, green, and blue pins, plus a negative pin (-) . When an RGB LED has a negative pin (-), it is said to have a common cathode. Some RGB LEDs have a common positive pin (+), and, as such, are referred to as having a common anode. For our circuit, we will use an RGB LED with a common cathode. Both the common cathode and common anode have the longest pins of the RGB LED...