Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to stop the sound on pin 8 using noTone().
Arduino
noTone([1]); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different pin number than the one where the sound is playing.
Forgetting to call noTone() to stop the sound.
✗ Incorrect
The noTone() function stops the sound on the specified pin. Here, pin 8 is used.
2fill in blank
mediumComplete the code to start a tone on pin 6 at 1000 Hz.
Arduino
tone([1], 1000);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong pin number.
Confusing
tone() with noTone().✗ Incorrect
The tone() function starts a sound on the specified pin at the given frequency. Here, pin 6 is used.
3fill in blank
hardFix the error in stopping the tone on pin 9.
Arduino
noTone([1]); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different pin number than 9.
Not calling
noTone() at all.✗ Incorrect
To stop the tone on pin 9, you must call noTone(9);.
4fill in blank
hardFill both blanks to play a 500 Hz tone on pin 4 and then stop it.
Arduino
tone([1], [2]); noTone(4);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping pin number and frequency.
Using the wrong pin number.
✗ Incorrect
Use tone(4, 500); to play a 500 Hz tone on pin 4, then noTone(4); stops it.
5fill in blank
hardFill all three blanks to start a 750 Hz tone on pin 3, wait 1 second, then stop the tone.
Arduino
tone([1], [2]); delay([3]); noTone(3);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong delay time units.
Mixing up pin number and frequency.
✗ Incorrect
Start the tone on pin 3 at 750 Hz, wait 1000 milliseconds (1 second), then stop the tone.
