Now we are going to add the piezo speaker in to the circuit. You do not need to complete the extensions in order.
Exercise
You must make a circuit that will play a note whose frequency is determined by a potentiometer. The note must turn turn on and off in one second intervals.
Extension 1
The note only plays once you are pressing and holding a button down.
Extension 2
The note turns on and off in an interval that is inversely related to its frequency. A lower frequency note will be long and drawn out. A higher frequency note will pulse in rapid succession.
Extension 3
As your potentiometer increases in value the notes heard through the piezo speaker always line up with the table found at http://www.phy.mtu.edu/~suits/notefreqs.html (Rounded to the nearest Hz). For example, if the speaker is playing 440Hz, the next note that is played is 466 Hz.
This will require the use of “if” statements and the “and” compound statement. Use && to represent “and”.
Scoring
Completing the exercise 50%
Extension 1 10%
Extension 2 10%
Extension 3 30%
Total 100%