Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Awesome Microbit

Download as pdf or txt
Download as pdf or txt
You are on page 1of 44

awesome

micro:bit
learn micro:bit fun and fast
PREFACE
In the name of Allah, the Most Gracious and the Most Merciful. Peace and
blessings of Allah be upon His messenger, Muhammad and all his family and
companions.

Alhamdulillah, all praises to Allah for the blessing and guidance in completing this
book.

This book is published specifically to help educators and student to learn and
master all the micro:bit related knowledge and skills. This book is structured as
one of the teaching and learning materials in carrying out micro:bit activities that
have been planned in the school. The content in this book is based on lab
exercise and mini project with complete circuit diagrams, block programming and
steps of the program developed to facilitate student's understanding.

This book have been written by Mr Johari bin Ghazali, Mr Azhar bin Ab Hamid and
Mr Mohamad Shahrin bin L Bari. We are the lecturers at Information Technology
and Communication Deparment, Polytechnic Kuching, Sarawak. We realize that
this book is still far from perfect. All the criticism and opinions from all parties are
very much welcome for the improvement of this book in the future.

Lastly, we would like to take this opportunity to express our gratitude to our
family, colleagues and those who have been directly or indirectly involved in the
production of this book from the start. May Allah SWT always be pleased with all
our efforts, InshaAllah.

We hope this book can inspire all the reader, especially the educators and
students who are interested in the knowledge in this field.
ABSTRACT
Nowadays, digital technologies are part of our life. Because of that it is important
to start teaching technologies in early life of every student. However, teaching
computer science or information technology in all level of education is not easy.
Therefore this book is produce as a reference material to help all the educators
and students who want to getting start learn micro:bit. This book will cover the
topic on introduction to Internet Of Things (IOT), Introduction to micro:bit, the
software and exercise which might help them to understand and get a better
ideas to developed an application using micro:bit. Various lab exercise is included
in this book to help them understand the use of every component and also to
help them to understand how the block programming language works. By refer to
this book, it will help them learn better and faster by follow all the lab exercise
and mini project. Once they follow all the exercise and mini project, thet might
develop a more interesting ideas in the future. The micro;bit might be small but if
we have all the knowledge and ideas, it might be a powerful devices. Learn the
basic is the most crucial part in a way of making a great application by using
micro:bit.
CONTENT

Introduction to Internet Of Things (IOT) 1

Introduction to Micro:bit 2

Introduction to Makecode software 4

Basic step using micro:bit 6

Exercise 7

Mini Project 32

Troubleshoot Tips 37
er net of
Int T)
gs (IO
Thin
Introduction to
Internet of Things

The Internet of Thing (IOT) is refer to the communication between


connected devices and leverage the data input either from embedded
sensors or other physical input. IOT also represent the communication
between devices through the Internet.

What make IOT very popular nowadays ? It is because IOT have the
capability to deliver a solutions that dramatically improve energy
efficiency, security, health, education and many other aspect in our
daily life. Because of the rapid development in IOT nowadays, it even
can underpin solutions that improve decision making and productivity.

In education it is good to give an early exposure to student about the


benefit of IOT and teach them a basic knowledge on IOT. There is many
IOT board that can help student to gain a knowledge in IOT, for
example micro:bit, arduino and raspbery. These board are very
popular, because it can help student to learn and make many IOT
application.

1
o:bit
micr
Introduction to
micro:bit

Micro:bit is a pocket-sized computer which we can see how software


and hardware work together to developed an application that can
make the hardware to interact with one to another. Technically it is
also known as microcontroller development board.It's a printed circuit
board as shown on figure 1 which contains a microcontroller which it is
possible to run it own program and connect it to a hardware. Figure 1
show every component on micro:bit board.

Figure 1 : Component on micro:bit board

2
Table 1 show the function for every component on the micro:bit board

Table 1 : Component on micro:bit board

Table 2 show the function for every sensor on the micro:bit board

Table 2 : Sensor on micro:bit board

3
kecode
ma
Intoduction to
makecode software

The software used to develop the micro:bit application was makecode


software. Figure 2 shows the user interface for the makecode software.
This software can be found by browsing the site
https://makecode.microbit.org. It can be used online or offline by
downloading the installer.

Figure 2

4
Here are the lighting notes for each interface layout in the software :

A-Simulation Zone B-Block Programming Zone


This is the zone where we This is the zone where we
can simulate the settings can pull out the code that
we have built without the have been translated in
need to connect or block form to the window
download the program into space of the settings zone.
the micro:bit. The method blocks have
been organized according
to categories such as basic,
input, musical, logical and
so on.

C-Code / Work Zone D-Download and Save Zone


This area is where we When the program are
create the desired ready to be built, we need
programme or application. to go to this zone to
The blocks of code will be download the program and
dragged into this area. The then save the file into
"On Start" and "Forever" micro:bit to allow micro:bit
blocks are the two special to read the program that
blocks that have been we have built.
offered.

E-Editing Zone
This zone allows you to
edit the code that you have
built. The functions
contained in this zone are
undo, foward, zoom in and
zoom out.

5
BASIC STEP ON USING
MICRO:BIT

1
Launch a makecode software
Go to https://makecode.microbit.org. You can
using this software online or you can also
download it and using it offline.

Do your program

2
You can do your program by using block
programming or by writing your code using
python or javascript programming
language.

Download the program

3
Once you finish with your program, you need to
download the program. You can do that by click
on the download button at the download / save
zone.

Insert the program to micro:bit

4
Once you download the program, make sure
that the file is in .hex format. Now you can
copy the file inside the micro:bit drive. Please
note that if there's a program before, it will
replace it.

6
AWESOME
EXERCISE
cise 1
Exer
LCD DISPLAY

MICRO:BIT

CODE BLOCK

7
STEPS

EXPLAINATION: This program will display “small love” on start


and followed by repetition for every 2 seconds of string
“Ismail”.

8
cise 2
Exer
SOUND

MICRO:BIT

CODE BLOCK

9
STEPS

EXPLAINATION: This program will show string “hello” and play a


melody thru a speaker.

10
cise 3
Exer
SOUND & BUTTON
PART 1

MICRO:BIT

CODE BLOCK

11
STEPS

EXPLAINATION: This program will produce a music if user press


“A” button.

12
cise 4
Exer
SOUND & BUTTON
PART 2

MICRO:BIT

CODE BLOCK

13
STEPS

EXPLAINATION: This program will produce a music if user press


“A” button.

14
STEPS

15
cise 5
Exer
SERVO MOTOR &
BUTTON

MICRO:BIT

CODE BLOCK

16
STEPS

This program will turn a servo 90 degree to right if button “A” is


pressed, turn 90 degrees to left if button “B” is pressed and
reset if button “A+B” is pressed.

17
cise 6
Exer
LED

MICRO:BIT

CODE BLOCK

18
STEPS

This program will turn a servo 90 degree to right if button “A” is


pressed, turn 90 degrees to left if button “B” is pressed and
reset if button “A+B” is pressed.

19
cise 7
Exer
BLINK LED &
BUTTON

MICRO:BIT

CODE BLOCK

20
STEPS

This program will make an LED blinking for every 1 second if


button “A” is pressed and turn off an LED if button “B” is
pressed.

21
STEPS

22
cise 8
Exer
MULTIPLE LED &
BUTTON

MICRO:BIT

CODE BLOCK

23
STEPS

This program will make one LED blinking for every 1 second if
button “A” is pressed, two LED blinking for every 1 second if
button “B” is pressed and turn off both LED if button “A+B” is
pressed.

24
STEPS

25
cise 9
Exer
LIGHT SENSOR
AND LED

MICRO:BIT

CODE BLOCK

26
STEPS

This program will turn on an LED if it is dark. A photo sensor


on the board will detect certain amount of brightness and will
turn it on once it reaches certain threshold.

27
cise 10
Exer
BLUETOOTH

MICRO:BIT

CODE BLOCK

28
STEPS

This program needs 2 micro: bit.


First micro: bit will send signal to switch on led on second
micro: bit if button “A” is pressed.
First micro: bit will send signal to switch off led on second
micro: bit if button “B” is pressed.
First micro: bit will send signal to displayed “:)” on second
micro: bit if button “A+B” is pressed.

29
STEPS

30
STEPS

Upload the block to first micro: bit.


Upload the same block to second micro: bit.

31
AWESOME
MINI PROJECT
JECT 1
PRO
CLAP TURN ON
AND OFF LIGHT

MICRO:BIT

CODE BLOCK

32
STEPS

This program will make LED turn on once the sound sensor
detect a loud sound. It also will turn off once the sound sensor
detect a loud sound again.

33
JECT 2
PRO
TEMPERATURE
AND SERVO MOTOR

MICRO:BIT

CODE BLOCK

34
STEPS

This program will create a TEMPERATURE GAUGE DISPLAY


ranging from 20C to 35C. A temperature sensor will sense the
current temperature and it will rotate a servo by mapping a
temperature degree Celsius to servo rotation degree.

35
STEPS

36
TROUBLESHOOT TIPS

Board not displaying as intended


Check your board version or code bugs
Check your current board version or double
check your code. There might be an error.

LED on board not flashing when


upload
Bad Cable or bad usb port
If micro:bot didnt show up on your
computer. Try another cable or another
port.

Board didn't power up when connect


to battery pack
Battery or battery pack problem
Recheck your battery position or make sure of
your battery power.
Change your battery pack

Code cannot upload to the board


Board Problem
Press the reset button and try to reupload
the code again.

The board feel hot and not working


Board burn
This might be because the board already
burn. You might need to change the board
or try to power off, press reset and try
reupload your program again.

37
REFERENCE
Patel, K keyur & Patel, M Sunil. (2016). Internet of Things-IOT : Definition,
Characteristics, Architecture, Enabling Technologies, Application & Future
Challenges. Research Article. Maharaja Sayajirao University
Wolfram Donat. (2017). Make : Getting Started with the micro:bit. San Francisco :
Maker Media Inc
Pradeeka Seneviratne. (2018). Beginning BBC micro:bit : A practical Introduction
to micro:bit development. Sri Lanka : Apress

You might also like