Add volume control to micro:bit music
The recent update to Microsoft MakeCode brings new music features to the micro:bit and this week we’re showing you how to add a volume control to your sound projects.
It’s really easy to get started making noise with your micro:bit – all you need is the MakeCode editor. If you have a micro:bit device, you just need a couple of crocodile clip leads and pair of headphones and connect them like this:
Setting the volume level
You can set the volume level using the set volume block. It uses numbers from 0 to 255, with 0 being silent, and 255 the loudest. 128 is somewhere in the middle!
Try it out
Try out the new volume feature for yourself with the Jukebox with volume project below. Iy shows you how to use the micro:bit’s built-in accelerometer sensor as a physical volume control, tilting it left to make the sound quieter and right to make it louder.
Making music with the micro:bit webinar
This week’s micro:bit webinar is also all about making music and sound!
We’re helping to show you how to code and make three simple projects in each session, perfect for newcomers using the micro:bit and for those learning at home.
Join the Micro:bit Educational Foundation team on Tuesdays at 4pm UK time, 11am EDT or watch it back later.