Circuit diagrams

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.

Get Mastering Arduino now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.