$USD
  • EUR€
  • £GBP
  • $USD
TUTORIALS micro:bit

micro:bit Tutorial: MakeCode and micro:bit

DFRobot Oct 10 2018 1387

An Introduction to MakeCode

MakeCode for micro: bit is one of the most widely used graphical programming environment from the micro: bit website. It is an open source project developed by Microsoft.

A Brief Introduction to micro: bit

micro:bit is a pocket-sized microcontroller designed for kids and beginners learning how to program, letting them easily bring ideas into DIY digital games, interactive projects and robotics.

micro:bit comes with a variety of on-board modules, including a 5x5 LED matrix (also supports light detection), 2 programmable buttons, motion detector, Compass and Bluetooth® Smart module. 

Additionally, you may attach more modules such as a servo motor, RGB LED lights through 5 I/O rings or 20 edge connectors.

The micro:bit can be used to realize many cool ideas. Everything you can imagine, a robot, electric instrument, or even a home automation system. The possibilities are endless! The micro: bit holds a host of innovative features such as 25 red LEDs to display messages and two programmable buttons to control game or control music. It can detect motion, recognize gesture,
and be interconnected with other devices or the Internet via Bluetooth connection.


The micro: bit is equipped with light and temperature sensors and other common sensing devices, which means that it itself can also produce a lot of common smart products used in our daily lives.

How to Use micro:bit

If you are new to micro: bit, you can start with the online programming platform- The MakeCode Editor, to learn about how to program the micro: bit.

Before getting started, please make sure that the following items are ready by your hand. In addition, you will also need a computer running operating systems such as Windows 10 / Mac OS / Linux and with Internet connectivity.

COMPONENTS LIST: 

Micro:bit Mainboard
USB cable

The following steps are based on Windows 10 OS. It can be used as a reference for other operating systems.

STEP 1: Open MakeCode 
Visit the MakeCode page from the following link: https://makecode.microbit.org/


STEP 2: Connect micro: bit to computer

Micro: bit connects to computer via the USB cable. The power indicator on the back side of the micro: bit will light up when connected.

Before programming, we should make sure that the mainboard is recognized by the computer. 

When micro: bit is connected, a "MICROBIT" directory will show up in “My Computer."


STEP 3: Start a New Project

Before starting a new project, we will need to first get familiar with the programming interface.


Simulation window: simulates the operating status of micro: bit. During the process of programming, you can always check how your program looks like the through the window.

Function area: Where you can find all the function blocks, including input, output, loop, logic, etc..

Programming area: Dragged the blocks from “Function area”, stack them up and build your program here.

Click "Project" at the top of the simulation window


Then, click "New Project."


STEP 4: Download the program and upload to micro: bit

When we have finished our program, we can now download it from the website and uploaded to micro: bit. We can also rename the project and save it in the browser. The project will stay in “my stuff ”.


Before downloading, we can check the simulated results in the simulation window. The buttons in the lower part of the simulation window can be used to control the analog micro:bit


Click "Download" in the lower part of the simulation window and select "Save As" in the pop-up dialog box.


Choose to save the “.hex” file to "MICROBIT Disk" and click "Save

During the process of downloading, the power indicator on the back of micro: bit will blink. When completed, it will stop flashing and keep on going.

Now you are all good for basic setups. Remember to visit our blog to check out more micro: bit projects. Please also leave a comment if there you have question or new idea to share.
https://www.dfrobot.com/index.php?route=DFblog/blogs


REVIEW