MicroPython Cookbook
上QQ阅读APP看书,第一时间看更新

There's more...

The two for loops presented in this chapter vary the way tones are played over a brief duration of time. In both examples, the tones play within one second but they have three or more different tones playing.

This is an excellent starting point to experiment with different variations of these loops. Because it only takes a second to play each loop, you can go through a fast cycle of experimentation and hear the results instantly. Try and experiment by changing the pitch or the pace at which the tones change.

In both loops, the pitch increased with each iteration. Try and experiment with a pitch that gets lower with each iteration.