Lesson 2 – Playing Music With the Snowflake Board
In this tutorial you will learn how to program the Snowflake board (with a BBC micro:bit of-course) to play some lovely Christmas music. The Snowflake board offers an easy electronics challenge for those wanting to play around with the BBC micro:bit and dabble with some simple circuits to get the feel of electronics and interact with the real world. The Snowflake board is a simple circuit in the shape of a Snowflake with a speaker on it. Wire up the Snowflake board, connect it up to your BBC micro:bit, put together the code and get it playing your favorite Christmas carols.
The BBC micro:bit has grown in popularity over the years. The micro:bit might be small electronics board but it’s packed with features (e.g. LED’s, accelerometer, temperature sensor, light sensor, compass, etc.) offering kids of all ages the opportunity to get started with their STEM (Science, Technology, Engineering, Math) learning journey. Kids can use the BBC micro:bit board to get started with coding, later on start dabbling with electronics and eventually try their hand at robotics all using the same little electronics board.
What do you need – Here’s the list of components you will need for this tutorials –
Let’s set it up – Before we can start programming the BBC micro:bit let’s spend sometime and wire up all the relevant connections on the board.
- Connect the black crocodile clip line to the GND port of the micro:bit, the other side of the black crocodile clip line to the G port of the snowflake buzzer.
- Connect the red crocodile clip line to the 3V port of the micro:bit, the other side of the red crocodile clip line to the V port of the snowflake buzzer.
- Connect the yellow crocodile clip line to the 0 port of the micro:bit, the other side of the yellow crocodile clip line to the S port of the snowflake buzzer.
Writing the code – We will program button A to play one tune and button B to play another tune.Feel free to customize the tunes for each of the controls.
Head over to the BBC Makecode editor (https://makecode.microbit.org/) and let’s start putting together the following code –
Check out the code at – https://makecode.microbit.org/_W27acib6j8D3