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

6. Working with Music

Pradeeka Seneviratne1 
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 ...

Get Beginning BBC micro:bit: A Practical Introduction to micro:bit Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.