In this recipe, we will learn how to play tones with a varying frequency and duration. By playing different tones repeatedly with a different duration each time, we can learn how to go beyond individual beeps. These steps will eventually lead to us playing melodies or varying tones that can make the same sound as an alarm.
Controlling tone, frequency, and duration
Getting ready
You will need access to the REPL on the Circuit Playground Express to run the code presented in this recipe.
How to do it...
Let's perform the following steps:
- Run the following lines of code...