Tutorial For Microbit Kit Op A4
Tutorial For Microbit Kit Op A4
for Micro:bit
Project Quick Start Guide
Table of Contents
About this kit 1- 4
Get to know micro:bit 5-12
Start Your Journey Here 13
1. Digital Eraser 13
2. Tilt Direction 14
3. Timekeeper 15
4. Dice Game 16
5. Telegraph 17
6. Pac-Man 18-20
7. Talented Singer 21
8. Polite Kid 22
9. Light Activated Alarm 23-24
10. Logic Block 25-26
11. Rainbow LED 27-29
12. Angry Girl 30-32
13. Unsocial boy 33-35
14. Remote Controller 36-39
15. Soil Moisture 40-41
16.Automatic Gate 42-44
17. Magnetic Field Detector 45-46
Keep Exploring 47
Easy Funny Affordable
Introduction to modules
1. Crowtail base shield for micro:bit
The Crowtail base shield is the core part of this kit, it acts as a bridge between Micro:bit board and
Crowtail modules. This shield integrates 6 Crowtail connectors and 2 Crowtail UART/IIC connectors
on board to allow you to plug Crowtail modules into the base shield to communicate with micro:bit.
Apart from that, the shield also reserves some pinouts such as P0, P1 for you to use a crocodile clip to
do some simple projects.
2
6. Crowtail LED 7. Crowtail RGB LED
This is a simple LED, just input power to light it up. The Crowtail RGB LED string integrates 4 pcs of WS2812 on the
board, so all LEDs can be controlled by only one signal pin. The
RGB LED can form all colors, and you can control each LED
separately to show different colors.
3
3 —— 4
The following illustration and table show the circuit symbol and logic combination for an AND gate. If 0
is called “false” and 1 is called “true” , the output is “true” when both inputs are “true” . Otherwise, the
output is “false” .
Input Output
A B F=A. B
A
0 0 0
F=A.B 0 1 0
B 1 0 0
1 1 1
The output is “true” if either or both of the inputs are “true” . If The NOT gate only has one input, it reverses the logic state.
both inputs are “false” , then the output is “false” .
Input Output
Input Output
A A B F=A+B
0 0 0 A
A A'
F=A+B A’
B
0 1 1 0 1
1 0 1 1 0
1 1 1
4
Get to know micro:bit
The BBC micro:bit is a pocket-sized micro-computer that can be used for all sorts of cool creations, from robots to
musical instruments, the possibilities are endless. It can be coded from any web browser in Blocks, Javascript,
Python, Scratch, and etc.
The micro:bit has 25 individually-programmable LEDs, these 5x5 red LEDs form a very
small section of a screen, and display information like words, numbers, and pictures
through a combination of ON and OFF LEDs.
There are two buttons on the front of the micro:bit - button A and button B, you can
detect when these buttons are pressed, allowing you to trigger code on the device. You
can detect events such as a single press, a double press, and a long press by program-
ming.
The LED screen works as a basic light sensor by reversing the LEDs of the screen to
become an input, which allows you to detect the ambient light.
The temperature sensor transforms the temperature in the The accelerometer measures the acceleration of your micro:bit,
ambient environment into digital signals that can be read by it can track motions like tilt, free fall and shake.
the micro:bit for calculating the current temperature of the
device.
The compass detects the earth’ s magnetic field, allowing you to detect which direction
the micro:bit is facing. The compass has to be calibrated before it can be used. Calibrating
the compass ensures the compass results are accurate. When the calibration begins, the
micro:bit will scroll the instruction “Tilt to fill screen” . You should tilt the micro:bit to move
the dot into the center of the screen around until you have filled up the whole screen to
calibrate the compass.
6
The radio feature allows you to communicate wirelessly
between micro:bits.
8
Quick start
Step 1. Connect it
Connect the micro:bit to your computer via a USB cable, then your micro:bit will show up on your computer as a drive called “MICROBIT” .
Step 2. Program it
Using the official online editor https://makecode.microbit.org/, write your micro:bit code.
The left part is a simulator, it will simulate the work of micro:bit after finishing the program. The middle part is our command area, there are
various program blocks we need. The rightmost area is the script area, you can drag and drop instructions into this area to form your program.
Drag and drop some blocks and try your program out in the Simulator in the Makecode Editor, the image below shows you how to program a
smiley face.
10
Step 3. Pick a name for your program, we name this project as “Smile Face” .
4 3
Step 5. Play
The micro:bit will pause and the yellow LED on the back of the micro:bit will blink while your code is programmed, the code will run
automatically once it’ s finished. Then look at your micro:bit, the screen will show a smiley face.
Note:
The micro:bit drive will automatically eject and come back each time you program it, but your hex file will be gone. It can only receive hex files
and won’ t store anything else.
11
The micro:bit app is the essential companion to the BBC micro:bit, available for iOS and
Android. Download the official micro:bit app for Android or iOS from the app store, the
app contains handy instructions on how to pair your micro:bit with the app.
12
Start Your Journey Here
1.Digital Eraser
Make a digital eraser to delete the content shown on the LED screen of micro:bit. Press the button A. The input
contents will show on the LED screen, press the button B, all contents will disappear. Remember that you can input
the content you like by changing “show icon” , “show number” and “show string” blocks.
Required Parts:
Micro:bit x 1
Programming with Makecode 1
Steps
1 Place an 'on button A pressed' block to run code when button A is pressed. 2
2 Place a 'show icon' block inside on button A pressed to display a heart on the
screen. Press the button A in the simulator to see the heart.
3 Add 'on button B pressed' and 'clear screen' blocks to clear the heart when we
press the button B. 3
4. Download the program to micro:bit, start your journey to digital mastery.
Try to control the LED screen by pressing button A and button B at the same time.
13
1
2.Tilt Direction
Make a tilt direction to know which direction you are tilting the micro:bit.
Required Parts:
Micro:bit x 1
1 Start an event handler, this handler works when you tilt and lift the micro:bit.
2 Start event handlers like step 1, this handlers tasks for you.
The accelerometer senses when the micro:bit is moved, try to show the moved
angle on LED screen.
14
3.Timekeeper
Make a stopwatch timer, let micro:bit count from 1 to 60 and count one number per second.
Required Parts: 1
Micro:bit x 1
Programming with Makecode
Steps
1 At first, define a variable as “S” . Then place the set s to 0 block inside the on
start block to initialization variable. 2
2 Put the 'if logic' block into the 'forever' block.
3
3 Set the logic judgment index to “S<60” .
4
4 If S is less than 60, then it will change 1 by one second, like on a clock.
5. Download the program to your micro:bit, see how many words you can write
in 60 seconds!
15
1
2
4.Dice Game 3
Create a digital dice on micro:bit, and play games with your friends.
Required Parts:
4
Micro:bit x 1
Programming with Makecode
Steps
1 Add an 'on shake' block to run code when you shake the micro:bit.
2 Add an L variable and place the set L to block in the shake event. Then Add a 'pick random'
block to pick a random number from 1 to 4 and store it in the variable named L.
3 Place an 'if' block under the pick random and check whether L is equal to 1. Add a 'show
ledLEDs' block to show the number 1.
4 Click the + button to add an else section, add block inside the else to show number 2.3.4.5.6
5. Click on the SHAKE button in the simulator, you will see the numbers on the screen if you try
enough times. Then download the program to your micro:bit, and play games with your friends!
Change the number to 26 letters, the letter will come out randomly after shaking it. Taking
it as the first letter, let’ s see who write the most words in one minute.
16
5.Telegraph
Use the radio to send messages to your friends, just like a telegraph can send messages.
Required Parts: 1
Micro:bit x 2
Programming with Makecode
Sending Hello
1 On start, add the radio set group block to set the group ID for radio 2
communication.
3. Download the program to your micro:bit that will be used for sending.
Receiving Hello 4
4 Add an 'on receivedString' block that will run code whenever a new
message comes in. The receivedString variable contains the string that
we sent.
Give your Mom a piece of micro:bit, and send a to show how much you
love her.
17
6.Pac-Man
Let’ s play the Pac-Man game on micro:bit. After eating the beans, your score will increase by one. Remember that
once you move out of the range of the LED screen, the game will be over, and the screen will show your score.
Required Parts:
Micro:bit x 1
Programming with Makecode
Step 1. Firstly, set the score, create the variable dot1 to store the position of the bean; create variable dot2 to store the position of
the player; create the variable x, y to record the player’ s position. The bean appears at random locations on the screen, and the
player’ s initial position is (2,2).
18
Step 2. Use the 'event trigger' block to move the player’ s position.
Step 3. Add an 'if logic' block inside the forever block to check if the player has eaten the bean. If you eat it, the score will increase by
1 and show the score on the screen. Then it will delete the bean and add a new bean at a random position.
19
20
7.Talented Singer
Let’ s play music on micro:bit, there are about 20 songs in the music library, use the buzzer to bring out the music.
Required Parts:
Micro:bit x 1
Crowtail base shield for micro:bit x 1
Crowtail buzzer x 1
Programming with Makecode
Step 1. Add a 'start melody' block inside the on start block.
Step 2. Download the program to the micro:bit, then enjoy the music.
Use your imagination to create a unique song, you can change the play tone, beat, tempo reset time, etc, on
the “Music” block.
21
8.Polite Kid
When you say “Hi” to micro:bit, it will respond with “Hello” .
Required Parts:
Micro:bit x 1
Crowtail sound sensor x 1
Crowtail base shield for micro:bit x 1
22
9.Light Activated Alarm
The micro:bit has a light sensor, it can measure the intensity of visible light.
Let’ s make a micro:bit alarm, it will beep and vibrate when the brightness
is greater than the set value.
Required Parts:
Micro:bit x 1
Crowtail base shield for micro:bit x 1
Crowtail buzzer x 1
Crowtail vibration motor
1 On start, create a variable “value” to store the light value, and set the
boundary of light level to 50. Create a variable “i” to store the number of times
the button A has been pressed.
23
2
2 Create a variable “read” to store the current light level. Then add an if logic
block to determine when the alarm clock rings.
3 The clock will always ring unless you press the button A for a specified
number of times.
4. Download the program to your micro:bit, put the micro:bit in a bright place to
see what will happen.
24
10.Logic Block
This is a fantastic project. Here the input is the same, but the output is different.
Required Parts:
Micro:bit x 1
Crowtail base shield for micro:bit x 1
Crowtail touch sensor x 1
Crowtail logic OR block x 1
Crowtail logic NOT block x 1
Crowtail LED x 1
25
1
2. Download the program to your micro:bit, then connect the logic
OR block and the NOT block to your micro:bit separately. Press the
touch sensor to see what will happen. The program and circuit are
suitable for NOT and OR gates. Although the OR gate has two
inputs, we just use one input to control the output. Try to press the
touch sensor, you will see different phenomena!
The boy falls into sleep so deep in the class, you need to shake him and call his name to wake him up. How do you simulate this
situation with your micro:bit?
After learning the logic block, we know that the AND gate has two inputs. Connect the touch sensor and sound sensor to the input,
only if you press the touch sensor and talk to the sound sensor at the same time will you “wake him up” .
26
11.Rainbow LED
Use the micro:bit to drive the Crowtail RGB LED to make a rainbow LED.
Required Parts:
Micro:bit x 1
Crowtail base shield for micro:bit x 1
Crowtail buzzer x 1
Crowtail RGB LED x 1
27
2
Programming with Makecode
Steps
1 Click on the Extensions to add the “Neopixel”
library to the command area.
1
28
Mission: Celebrate a birthday Difficulty Level:
Use the RGB LED and buzzer to celebrate a birthday for your friends. Light up the RGB LED and play a “happy
birthday” song at the same time.
29
12.Angry Girl
Use micro:bit, touch sensor, buzzer and vibration motor to simulate an angry girl. When you touch the touch sensor,
it will shout and jump to show its anger.
Required Parts:
Micro:bit x 1
Crowtail base shield for micro:bit x 1
Crowtail touch sensor x 1
Crowtail buzzer x 1
Crowtail vibration motor x 1
30
1
Programming with Makecode
Steps
31
Try to calm the angry girl down after you press the touch sensor, the micro:bit will play light music
and the LED will change to be a breathing lamp to calm her down.
32
13.Unsocial boy
Use the micro:bit to simulate an unsocial boy. He doesn’ t like others getting too close to him. Connect the LED to
your micro:bit, and the micro:bit will light LEDs in different colors to show his feelings according to different
distances.
Required Parts:
Micro:bit x 1
Crowtail base shield for micro:bit x 1
Crowtail LED x 3 (red, yellow, green)
Crowtail ultrasonic sensor x 1
Programming with Makecode
Steps
1 Firstly, click on the Extensions, then search “sonar” , add the
sonar package to your Makecode.
33
1
3
4
3 Set the program so that when the distance
that ultrasonic sensor detects is more than
100cm, the green LED will light up, which means
it is a comfortable distance.
34
Mission: Make friends with him Difficulty Level:
Try to use the ultrasonic sensor and RGB LED to make a more social boy. When someone approaches him, the RGB LED will flash and
the LED screen will show a smiling face. The boy feels so happy to make friends with you.
35
14.Remote Controller
Make the micro:bit become a remote control and use the buttons on your remote control to turn the LEDs on and
off.
Required Parts:
Micro:bit x 2
Crowtail base shield for micro:bit x 1
Crowtail LED x 1
36
Programming with Makecode
1
Sending the order
1 On start, add the 'radio set group' block to set the group ID for
radio communication.
37
4. Add an 'on receivedNumber' block that will run code whenever a new order comes in, the receivedNumber variable contains the
number that we sent.
5. Download the program to your other micro:bit that will be used as the receiver.
38
Mission: Let ‘s rock Difficulty Level:
Try to use this remote controller to control the RGB LED, buzzer and vibration motor at the same time. How about we
press button A and button B to make them all work at the same time?
39
15.Soil Moisture
Use the moisture sensor to detect the moisture of soil and show the value on the LED screen.
Required Parts:
Micro:bit x 1
Crowtail base shield for micro:bit x 1
Crowtail moisture sensor x 1
Crowtail buzzer x 1
40
Step 2. Display the detected soil moisture value on the
LED screen.
Try to use the micro:bit, moisture sensor and buzzer to make a guard for your plant. When the soil moisture is below the set value, the
buzzer will warn you to water your plant.
41
16.Automatic Gate
Automatic gates are widely used in public places, such as shopping malls, hotels, banks, etc. In this project we will
use the ultrasonic senor and servo to simulate the function of automatic gates.
Required Parts:
Micro:bit x 1
Crowtail base shield for micro:bit x 1
Crowtail ultrasonic sensor x 1
Crowtail 9G servo x 1
42
1
43
Use your sound sensor, ultrasonic sensor, and servo to make a door where only if you stand in front of the door
and say a magical phrase such as “Open Sesame” will it open for you.
44
17.Magnetic Field Detector
Use the magnetic switch to make a magnetic field detector. When it detects a magnetic field, the LED will light up
to remind you that there is a magnetic field nearby.
Required Parts:
Micro:bit x 1
Crowtail base shield for micro:bit x 1
Crowtail magnetic switch x 1
Crowtail LED x 1
Magnet x 1
45
1
Programming with Makecode
Steps
1 Create a variable “Magnetism” to store the state of the
magnetic switch. 2
2 When the magnetic switch detects a magnet, the LED will light
up.
46
Keep Exploring
We also provide MicroPython lessons for this kit, it can be
47