Plays an array of notes one after the other at specified durations for each one.
buzzer.playSong()
works just like buzzer.playNotes
, except now you can determine the duration for each note, which allows you to create music like what you would normally hear.
buzzer.playSong(notes, tempo);
Name | Type | Required? | Description |
---|---|---|---|
notes | Array of Arrays | Array that has smaller arrays inside it, each smaller array has two items in it: The note to play, and the duration of that note. | |
tempo | Number | The tempo at which to play the notes. |
Found a bug in the documentation? Let us know at documentation@code.org