You are on page 1of 30

QUICK START GUIDE

CONTENTS

01
The micro:bit initiative

02
The micro:bit

05
Getting started with the Mmicrosoft Block
Editor

06
Uploading programs to the micro:bit

07
Lessons
T h e m i c r o : b i t i n i t i at i v e

Nowadays, computing and digital technology can


be found everywhere, but the emphasis seems to
have shifted from the creation of technology to
the consumption of it.

Micro:bit provides an introduction to coding on a


simple hardware platform. Its purpose is to excite
and empower a new generation of digitally
creative young people.

The micro-bit can help learners to develop an


understanding of technology and computing
offering the opportunity to apply complex think-
ing, analytical and problem-solving technique.

It is designed to be a starting point to get the


young interested in coding so that they can move
on to a more sophisticated devices after.
the micro:bit

The micro-bit is a simple computer. it is


programmed using another device like a PC to
write the program, which is then compiled and
downloaded onto the micro:bit.

The device has a display of 25 LEDs and some


simple input controls that can be used in a
number of ways. It is small enough to wear and
even fit into a pocket.

It has an accelerometer which can detect move-


ment and a Bluetooth Low Energy which allows it
to be part of the ‘Internet Of Things’.

For those who want more, the micro:bit can be


connected with other devices including Arduino
and Raspberry Pi. Thus more complex projects can
be executed.
the micro:bit

Front of board

LED LED Matrix


Its coordinate starts at (0,0) on 5x5 array of light emitting
the top left hand corner. Also, it diodes (LEDs), which can
is relative as such even when the be set to on/off. The
board rotates, (0,0) is still at the brightness of the LEDs
top left hand corner. can also be controlled.

Button A
The micro:bit
detects when Button B
this button See Button A.
is being
pressed.
Pressing it
completes an
electrical Holes
circuit. For sewing,
Basically, the mounting and
button is a hanging.
form of
input.

PINS P0, P1, P2 3V and GND


Pins for attaching external sensors, A source to power
like thermometers or moisture external device, like a
detectors, and actuators, like a motor. They also
motor. It can be either input or enable capacitive
output and either digital or touch (using an object
analogue. as a switch).
the micro:bit

back of board
Bluetooth Low Energy Antenna USB Plug
The micro:bit will be a peripheral Programs can be
device and it can talk to a central downloaded from Macs
device like a smartphone. All you have and Windows onto the
to do is to pair it through an app. This micro:bit via a USB. .
means the micro:bit can send signals
to and receive signals from a central
device. BLE will be used to ‘flash’ new Button R
programs onto the micro:bit. System button
(reset button).
Has to be
Processor pressed to
All the ‘flash’ new
micro:bit’s code onto the
programs and device over
data are stored BLE.
here. This tiny
chip designed Battery
by ARM has This socket
128kB flash connects the
memory and external
16kB RAM battery pack
memory. to the board.

Compass Accelerometer
A sensor to detect magnetic Converts analogue information
fields, like the Earth’s, about how quickly the micro:bit’s
allowing the direction of the speed changes to a digital form
micro:bit to be determined that can be used in micro:bit
and converted to a digital programs. Output from the
form that can be used in accelerometer is in milli-g.
micro:bit programs. Output Allows the BBC micro:bit to be
from the compass is in used to control movement of
degrees. on-screen characters.
G e t t i n g s ta r t e d w i t h t h e
microsoft block editor
Create a Block Script
01 02 03
Go to microbit.co.uk in Click Create Code. Click new project.
your web browser.

04
Go ahead and click some of the buttons on screen to see what they do.

Click to exit the editor and it takes you Clicking will bring you
back to a list of your scripts. The open to the Block Editor
script is automatically saved in the cloud. Documentation page.

Click to translate
your Blocks script
into a Touch Develop
Coding area script.

Click to translate
your script into a
file that can run
on your micro:bit.

Click to
execute your
Click a category name to see the script in the
available blocks. To add a block, web browser,
drag it into the coding area. To showing you Zoom feature
remove a block, drag and drop it the results
from the coding area, to the trash on the Trash can
can icon. To combine blocks, drag right-hand
and drop different blocks so that side of the
they fit together like puzzle pieces. screen.
uploading programs to the
micro:bit
Getting your programs onto the micro:bit?

Getting your program onto the micro:bit itself is quite easy:

Hit the compile button in the code editor. A .hex file will be
created.

Plug the micro:bit in to your computer’s USB port using a standard


micro USB cable (supplied). The micro:bit should show up as a USB
storage device.

Drag the .hex file onto the drive that corresponds to the micro:bit.
Once the system LED has stopped flashing, press the reset button
on the back of the micro:bit to start the program.

Once a program is uploaded to the micro:bit, the device can be


unplugged and will run independently, as long as the user has
attached a battery pack.
Lesson

S c i s s o r s pa p e r s t o n e
Programming the above name game using accelerometer

Outcome
A simple ‘scissors, paper, stone’ game. Each time you shake the
micro:bit, one of the three shapes will be be randomly chosen.

01
Follow the steps as shown in
the previous page to create a
Block Script and rename it
‘scissors paper stone’’.

02
From the category column:

Select the Input tab and drag


the ‘on shake’ block to the
coding area.

Select the Variable tab and


drag the ‘set item to’ block to
the coding area.

Select the Maths tab and drag


the ‘pick random 0 to 4’ block
to the coding area.

03
Combine the blocks. This
combination allows the
micro:bit to randomly choose
one of the images, that we will
be creating in the next step,
upon shaking the micro:bit.
Lesson
04

As mentioned, let’s create the


3 images. Drag the ‘show leds’
from the Basic tab and click on
the LED matrix to create the
scissors, paper and stone
shapes as shown on the right.

05

We have created the code to


generate random number for
the images but we yet to set
which number represents
which image. To do so, drag
the two blocks shown from the
Logic and Variables tabs twice.
Click the ‘items’ block to
rename it to ‘image’ and then
drag it to the Logic block (blue
arrow). Next, set 0 for the
‘scissors’ LED and 1 for the
‘paper’ LED.

06

To combine the blocks in Step


05, we have to use the ‘if’
from the Logic tab. To have
the ‘else if’ click the blue
settings button and drag the
‘else if’ block and another
‘else’ to obtain the same as
the image shown on the right.
An explanation of what it
means will be shown in the
next step.
Lesson
07

Let us now combine Steps 05


and 06. The image on the right
shows the outcome of it. What
it means is that if the random
number ‘0’ is chosen i.e true,
it will do the first statement.
In this case,the first image will
flash. Else if random number
‘1’ is chosen i.e true, it will
execute the second statement
(second image will flash). If
none of the random number is
true the third statement or
the third image will flash.

08

Now, we can combine all the


blocks together. These are the
codes to the game of ‘scissors,
paper and stone’. Press the
run button so that you can
test your program on the
simulator.
Lesson
08

If we stop at the last step, the


image o the LED will continue
to light up. To prevent that
from happening, let’s create a
timer to pause for 2 seconds
before the screen is cleared.
From the category, select the
pause block in the basic tab.
Change the number to 2000
since we want it to pause for
2 seconds. Next select the
clear screen block and snap
the blocks into place.

You should now have a finish program and are able to compile it
before transferring the file to your micro:bit.

What’s next?

Use Microsoft Touch Develop. You can transfer your ‘scissors,


paper, stone’ program into Microsoft Touch and learn how it is
coded from it. Also, try using other editors that are readily
available to further enhance your coding skill.

Code Kingdoms JavaScript MicroPython Editor


Editor
Hack your BBC micro:bit with
A visual editor that uses Python, an easy-to- learn
introductory chunks of programming language for
JavaScript. You can move to everyone, from kids to
text-based input as your skills teachers to professional
progress. software engineers.

Samsung Android App

An app for on-the-go BBC micro:bit programming. It will also


enable BBC micro:bits to talk to and control phones and tablets!
Teacher resources coming soon.

You might also like