buzzer.playSong

Category:Circuit

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.

Syntax

buzzer.playSong(notes, tempo);

Parameters

Name Type Required? Description
tempo Number The tempo at which to play the notes.
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.

Found a bug in the documentation? Let us know at documentation@code.org