Start Your Micro:bit Programming Trip

by RayM81 in Circuits > Gadgets

1223 Views, 4 Favorites, 0 Comments

Start Your Micro:bit Programming Trip

首页图片.jpg

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.

Note:
For more funny creation, you can pay attention to : http://www.elecfreaks.com/

Our product store: http://www.elecfreaks.com/estore/

1.JPG
图2.png

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.

Get to Know Makecode Interface

图3.png

Next, log onto web: https://makecode.microbit.org/ .

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.
1. Micro:bit: Return to homepage of micro:bit.

2. Projects: To build a new program or open local program or even official programs or cases.

3. Share: Share your program online. You can share a web link or embedded into your website.

4. Blocks/JavaScript: Choose Blocks or JavaScript to do program and shift between these two languages.

5. Help: To get help or support.

6. More: Program and code compiling settings.

7. Microsoft: Return to Microsoft Makecode homepage.

8. simulator: Real-time simulator. When you change your program, the virtual micro:bit can monitor your program in real time.

9. Blocks: Modules used to build a program.

10. Code compiling interface: A place for you to write code.

11. Download: To download program into your computer or micro:bit.

12. Name or Storage: Rename your program and set a storage route.

13. Undo and Zoom: Undo and redo your operation; zoom in or out your program bricks.

Next, let’s take an example to learn how to use Makecode. We are going to write a heart-bit program for micro:bit.

Make a Program

1.gif
图4.png

Step 1:

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.

Place Bricks

2.gif

Step 2:

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.

Name Brick

3.gif

Step 3:

Copy brick “show icon” and choose pattern “heart” in the drop-down list.

Add Delay

4.gif
5.gif

Step 4:

In order to prevent too fast rotation of pattern displayed, we have to add a little delay.To this step, we have completed our whole programming. You can see program operation in the left simulator

Download Hex File

6.gif

Step 5:

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:

Program Finished

7.gif

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.

​Relative Readings: