Bird
0
0
Arduinoprogramming~20 mins

noTone() to stop sound in Arduino - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Tone Stopper Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output on the buzzer?
Consider this Arduino code snippet. What will the buzzer do when this runs?
Arduino
tone(8, 1000); // Play 1000 Hz tone on pin 8
noTone(8); // Stop the tone immediately
AThe buzzer never plays any sound.
BThe buzzer plays a 1000 Hz tone briefly then stops immediately.
CThe buzzer plays a 500 Hz tone instead of 1000 Hz.
DThe buzzer plays a continuous 1000 Hz tone without stopping.
Attempts:
2 left
💡 Hint
noTone() stops any tone playing on the specified pin.
🧠 Conceptual
intermediate
1:30remaining
Why use noTone() in Arduino?
Which of these best explains why you would use noTone() in an Arduino sketch?
ATo change the volume of the buzzer sound.
BTo start playing a tone on a pin at a specific frequency.
CTo stop a tone playing on a pin so the buzzer becomes silent.
DTo make the buzzer beep faster.
Attempts:
2 left
💡 Hint
Think about what happens when you want silence after a sound.
🔧 Debug
advanced
2:30remaining
Why does the buzzer keep playing?
This code is supposed to play a tone and then stop it after 2 seconds, but the buzzer keeps playing. What is the problem?
Arduino
tone(9, 440);
delay(2000);
noTone(9);
Atone(9, 0) does not stop the tone; noTone(9) should be used instead.
Bdelay(2000) is too short to stop the tone.
Ctone() needs a third parameter to stop the tone.
DThe buzzer is connected to the wrong pin.
Attempts:
2 left
💡 Hint
Check how to properly stop a tone playing on a pin.
📝 Syntax
advanced
1:30remaining
Identify the syntax error
Which option contains the correct syntax to stop a tone on pin 7?
AnoTone(7);
BnoTone 7;
CnoTone(7)
DnoTone7();
Attempts:
2 left
💡 Hint
Remember how functions are called in Arduino (C++).
🚀 Application
expert
3:00remaining
How many times does the buzzer beep?
What is the number of beeps heard from the buzzer after running this code?
Arduino
for (int i = 0; i < 3; i++) {
  tone(10, 1000);
  delay(200);
  noTone(10);
  delay(200);
}
A6 beeps
BNo beeps
C1 beep
D3 beeps
Attempts:
2 left
💡 Hint
Each loop iteration plays one beep then stops it.