O'Reilly logo

Beginning BBC micro:bit: A Practical Introduction to micro:bit Development by Pradeeka Seneviratne

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Pradeeka Seneviratne 2018
Pradeeka SeneviratneBeginning BBC micro:bithttps://doi.org/10.1007/978-1-4842-3360-3_6

6. Working with Music

Pradeeka Seneviratne
(1)
Mulleriyawa, Sri Lanka
 
In this chapter, you learn how to use the micro:bit music library to build and play simple tunes. The music library allows you to build music by combining music notes, octaves, beats (duration), accidentals (flats and sharps), and so forth. You can also use built-in melodies in your applications.
By default, the music module expects the speaker to be connected through micro:bit’s pin 0. However, you can use any analog pin to connect the speaker (or multiple speakers) by defining the output pin to override the default pin 0.

Connecting a Speaker

You can connect a speaker ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required