±«Óãtv

Playing with the new micro:bit - three MakeCode projects for you to try out

We took part in a coding workshop as the pocket sized computer got an update - see what we made and try them for yourself!

Published: 9 February 2021
  • James Gibson

    Trainee Research Technologist

Recently at ±«Óãtv Research & Development, we got our hands on the new , a pocket-sized computer first launched in 2015 to help teach computer science. The first generation of this device was initially developed in collaboration with ±«Óãtv R&D - as we described it back then: "[it's] an entry-level, pocket-sized computer that children can program to do all sorts of fun and clever things."

Two new features of the micro:bit v2 are the built-in speaker and microphone. To help you create new projects that use these, code blocks (ready-made components) such as; tone, pause, volume, tempo, and sound level have been added to the .

So to test out these new features, 30 members of R&D took part in a workshop run by the , where the brief was to split off into groups and create something from one of the following themes:

  • Re-enact a famous line from a film
  • Make a 'theremin' and perform a song with it
  • Make a mimic that perfectly sings a song

Below are three examples we created during the workshop. If you would like to give them a go and see what you could make, we have links to access the code in the .

Taylor Swift Jukebox by Oscar Schafer

 

Taylor Swift Jukebox - micro:bit Example

I explored how the micro:bit v2's new capabilities could be used to play out some hit tunes. Piecing together tone blocks of various lengths, I was able to put together recognisable snippets from various Taylor Swift songs. I put these sequences of tones into different function blocks which could then be called. To play a song snippet, you shake the micro:bit – triggering its "shake" gesture recognition. From there, a song is randomly selected and the appropriate function called. To add a visual element, I used the "show LEDs" block to spell out "TAY TAY" – with the letters radiating out from the centre pixel on the LED matrix.

Possible Extensions

A future development could maybe use some of the  demoed by the micro:bit team to create a guessing game where you have to say the name of the song played out.


Light Theremin by Henry Cooke

 

Light Theremin - micro:bit Example

I made a theremin-like thing! It uses the micro:bit's light sensor, one of the buttons, and the speaker. While I hold down button A, a tone is played out of the speaker whose pitch is set by the amount of light detected by the sensor. I can then 'play' this like an instrument by waving my phone torch above the sensor and holding the button down when I want to sound a note. The fun thing about this is, it's very easy to make sliding notes by holding down the button while the torch moves.

Possible Extensions

There's a couple of possible extensions. First: tweaking the range of notes made, using the "map" block to map the amount of light detected by the sensor to a different range of frequencies of tone. Currently, it's C3 to B6, chosen fairly arbitrarily. Second: adding another control for volume level, so it's more like a 'proper' theremin. You could do this with the motion sensor, for instance, but then you'd be turning the light sensor away from the torch!


Light Theremin in C Major by Galen Reich

Light Theremin in C Major - micro:bit Example

For this example you will also need to to a MicroPython editor and use the editor to .

I also made a theremin-like musical toy! Like Henry's version, this one is played by changing the amount of light falling on the micro:bit. But my theremin plays notes in the C major scale over three octaves while holding the A-button down instead.

The program starts by calibrating the light level, beginning with the darkest light level and finishing with the brightest. Then the program waits for the A-button to be pressed before playing a note which corresponds to how bright it is.

Possible Extensions

There is no volume control in this program (it's either playing a note or not). A second micro:bit could be used to control the volume, and the in-built radio could be used to communicate the values between the micro:bits.


 

 ±«Óãtv Microbit box

It's great to see the impact this device initially developed in collaboration with ±«Óãtv R&D has had on computer science education across the globe and exciting to learn about the new v2 features which will hopefully mean it can continue to enable young people's interest in technology.

We had great fun making lots of fun noises with the new speaker, and we would love to see the results of what you manage to create, please tweet your creations to us @microbit_edu.

Thanks to Gareth, Jonny and Mark from the Micro:bit Foundation for facilitating the workshop. I hope that hearing about what we created with the new micro:bit has inspired you to see what you could make.

Rebuild Page

The page will automatically reload. You may need to reload again if the build takes longer than expected.

Useful links

Theme toggler

Select a theme and theme mode and click "Load theme" to load in your theme combination.

Theme:
Theme Mode: