









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Three piano notes: low, middle, and soprano C.
Middle C has a frequency of 261.63 Hertz (Hz).
Speaker Produces Sound
cross section of a common speaker
The permanent magnet is mounted behind the voice coil and pole piece shown in the image.
Wiring the Speaker
Making Sound Sequences (Melodies)
Using Arrays
An array is a sequence of values that are related in some way.
Make an array that will contain four integer values, you could create it like this
Can access the elements in an array at any given index by putting the index of the relevant value in a square bracket after the variable name.
If you want to set the brightness of an LED connected to pin 9 to the third entry in an array, for example, you can do so like this:
Can change one of the values of the array, you can do so in a similar fashion:
Use these arrays (as shown in these examples) to create a structure that can hold the sequence of notes that you want to play on your speaker.
Play a Song on a Speaker