Micro:bit is BBC launched micro-computer product for children at grade 7. Since it it a product designed for children, then every step of operation must be easy enough for children to understand. BBC do not disappoint us for the biggest feature of micro:bit is very easy to use. If you have never touched programming, that doesn't matter. Microsoft has developed a programming environment based on web for micro:bit. It is named Makecode, which use Blockly based on Google to compile code just like playing bricks. You just have to drag blocks, then you can make a program. You can done it by yourself alone, or with the help of your parents. To program with your parents, it will be a good time to enjoy family love.
In the following passages, we are going to show you a detailed course of Micro:bit and start your programming trip together.
Today, let's learn how to use Blocks interface to compile your first program.
First of all, connect micro:bit to your computer.
Use a USB cable to connect micro:bit to your computer, then you will find the yellow light on micro:bit lighted.
And on your computer, micro:bit will be loaded into your computer as a outer storage device. If you see an outer storage device named MICROBIT in your computer, then it shows you have complete the connection successfully.
We will see the interface like the above picture. And then, let's get to know each segment function according to the serial number in the picture.
We are going to write a heart-bit program for micro:bit.
Build a new program and name it "heart".
We can see 2 bricks already existed in the compiling interface. If you have played Arduino, you will find this is very similar to Arduino initial code. "On Start" is for initial brick and only carry out once. "Forever" is for circulation brick which makes program circulate.
Choose "show icon" in "Basic" brick, drag it into the right compiling interface with your mouse and embed it into brick "forever". When you release your mouse, you will hear a crack voice, which shows your brick is well- placed.
Copy brick "show icon" and choose pattern "heart" in the drop-down list.
In order to prevent too fast rotation of pattern displayed, we have to add a little delay.
After checking and no default founded, download your program into micro:bit. There are 2 methods for download: one is to preserve ".Hex" of the program in your computer and then copy and paste into outer storage device "MICROBIT" just like a USB flash disk , the other is download program directly into MICROBIT. Here, we use the latter method:
Once we completed download, your program will run automatically. You can see your micro:bit and check whether the animation on display is same like your program.
Now, you have finished your first micro:bit program. Isn't it make you feel a sense of achievement? You can use "share" to send the program link to your friends and tell them your experience to share your happiness of programming.
Or you can embed your program code into website or blogs, just like the following:
In the share web page, not only you can see whole code, but also check simulator and download program just like Makecode.
How can we know someone is closing beforehand?
How to make a counter with micro:bit?
Elecfreaks Micro:bit Adapter
Light Micro:bit with Mbed
How Micro:bit works with octopus? We made a Raining Alarm demo