Recall & Review
beginner
What does the
tone() function do in Arduino?It plays a sound of a specific frequency on a speaker connected to a pin, creating a tone or note.
Click to reveal answer
beginner
How do you stop a tone that is playing on a pin?
Use the
noTone(pin) function to stop the sound on that pin.Click to reveal answer
beginner
What are the three parameters of
tone()?1. The pin number where the speaker is connected.<br>2. The frequency of the tone in Hertz.<br>3. (Optional) The duration in milliseconds to play the tone.
Click to reveal answer
intermediate
Why do we use arrays when playing melodies with
tone()?Arrays store sequences of notes and their durations so the program can play melodies by looping through them.
Click to reveal answer
intermediate
What happens if you call
tone() on a pin that is already playing a tone?The new tone replaces the old one immediately on that pin.
Click to reveal answer
Which function stops a tone playing on a pin?
✗ Incorrect
The correct function to stop a tone is
noTone(pin).What does the second parameter of
tone(pin, frequency) represent?✗ Incorrect
The second parameter is the frequency of the tone in Hertz.
How can you play a melody using
tone()?✗ Incorrect
Melodies are played by looping through arrays of notes and durations, calling
tone() for each.What happens if you omit the duration parameter in
tone()?✗ Incorrect
If duration is omitted, the tone plays continuously until stopped.
Which Arduino pin type is required to use
tone()?✗ Incorrect
tone() works on digital output pins connected to a speaker or buzzer.Explain how you would use the
tone() function to play a simple melody on an Arduino.Think about storing notes and durations, then playing each note one by one.
You got /4 concepts.
Describe the role of the frequency and duration parameters in the
tone() function.Frequency is like the musical note, duration is how long you hear it.
You got /4 concepts.
