Python + Micro:Bit = MicroPython !!!
This term in Tinker Education’s intensive coding class, students are using Python Programming Language and Micro:Bit physical computing for invention.
Last Saturday’s mission asked students to ‘make music using the micro:Bit’.
The idea that you can use code to generate sound is easy and fun.
- Micro:Bit module
- Micro:Bit System installed on the computers
- Python Programming Language.
Step 1: Connecting the speaker.
With the use of crocodile clips, students attached pin 0 and GND to the positive and negative inputs on the speaker – it doesn’t matter which way round they are connected to the speaker.
Step 2: Import Music.
The students started to code by first importing music using the music module on Microbit (see screenshot below). This module contains methods used to make and control sound.
Step 3: Creating own Tunes
In the students screenshot below, he has used the range function to generate a range of numeric values which define the pitch and the tone.
Step 4: Listening to your sound.
Because everyone has a different taste in music, each student chose different types of melodies. Some chose Blues, Wedding, Birthday etc. The fun part was listening in on the speaker to hear the melodies they were able to create on their own.