For this particular example, we will need two LEDs and one buzzer. The wiring connections of the LEDs and the buzzer to the RPi are as follows:
We can see the following from the connection diagram:
- The positive (anode) pin of the first LED is connected to the wiringPi pin number 15, while the negative (cathode) pin is connected to the physical pin number 6 (the ground pin).
- The positive pin of the second LED is connected to the wiringPi pin number 4, while the negative pin is connected to the physical pin number 14 (the ground pin).
- One pin of the buzzer is connected to the wiringPi pin number 27 and the other pin is connected ...