Here is the circuit diagram that we will use for all code samples in this chapter:
This diagram shows that the ground pins on both the speaker and piezo buzzer are connected to the ground rail on the breadboard. The power pin on the piezo buzzer is connected to pin 8 on the Arduino, and the power wire on the speaker is connected to pin 7 on the Arduino.