Microbit Simple Hello World #tt6
Tinkerer: Lory Livezey
For our first Micro:bit project, we're going to start out with something simple. We're going to display "Hello World" or "Hello <your name>" across the led grid.
To learn the very basics of programming the Microbit and transferring that program from your computer to the board
What you will need
Open MakeCode Web Site
You will be programming your micro:bit using this web site. Let's first browse out there and take a look.
You don't need to log into the site. It remembers what you've been working on using your computer's cookies. I'll explain more about that a little later. Now that we're in, let's take a look around.
Tour of the Site
left side of the screen has what is called a "simulator". There is a picture of a micro:bit that you can interact with much like you would the real thing. You can click the A and B buttons, connect sensors to the terminals, as we'll do in later lessons. The controls at the bottom allow you to stop, start, or slow down your program. You can download your program onto your micro:bit.
middle of the screen there are tools that you can use, and they are in categories. You'll be using the
Basic tools in this tutorial. We'll be going over the others as we need them in different tutorials.
right side of the screen is our work area. We'll be dragging different tools over there to create our program.
Time to program. Let's get started!
Create an Icon When Micro:bit Starts
On the right side of the screen you will see two objects that say
on start and
forever. They mean just that -- whatever you put in
on start will happen when the micro:bit is turned on, and whatever you put in
forever will happen in a
forever loop. It's like the song that never ends... it goes on and on my friend.. if you know what I mean. ;)
For now, let's just have something display when the micro:bit starts, whatever you like:
Click Basic > Show Icon > Drag the Block into the 'on start'
click into the container block. Once it does, then you can select which icon you want to show.
Create 'Hello World' on A Button Click
We are going to have 'Hello World' (or 'Hello
This time, we're going to use a
container block in the
Click Input > On Button A Pressed (drag to right)
Now that we have our
container block which is a
trigger for something to happen, we need something in it that will
happen when the A button is pressed.
Basic > Show String > Drag to 'on button A pressed' > Change Text
You can change the text to whatever you want to display.
Next, you'll test it by clicking on the 'A' button in the
simulation on the left. Do you see the text? Good! Next, let's do it for
Download onto the Micro:bit
Our final step is to download our program onto the Micro:bit. You'll need to plug your micro:bit into your computer using a
USB Cable. Once you plug it in, you should see a drive in Windows Explorer.
To download the program, simply click the
Download button. A file will be downloaded, and once you locate it, you can just drag it to your
Microbit drive to copy to the device.
The micro:bit should reset, and when it does, display the icon that you chose. Click the
A button to display your message!
Program the "B" button (the one on the right) to display "Goodbye,
- Click on the other options in the side menu, such as "Music" and "Radio". What do you think they could be used for?
- Can you think of any fun projects you would like to do with the Microbit?
In this tutorial, we learned how to use some basic programming blocks using the Make Code web site, and downloaded the program to the micro:bit.
|Keyestudios 37 Sensor Kit with the Microbit|
|Microbit Accelerometer Basics #tt8|