Controlling tone, frequency, and duration

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.