IBIT Racer ActivityBookE
IBIT Racer ActivityBookE
Programmable robot
with micro:bit
Activity book
Credits
iBIT ; the robot controller board are trademarks of Innovative Experiment Co., Ltd.
iBIT robot kit, iBIT robot kit logo, INEX, and INEX logo are trademarks of Innovative
Experiment Co., Ltd.
All product and service names mentioned herein are the trademarks of their respective
owners.
Programmable robot with micro:bit 3
Contents
1 - iBIT robot kit plus introduction and part list...........................................................................5
3 - About micro:bit..............................................................................................................................31
Chapter 1
For students and teachers; this kit comes with a comprehensive set of activities
and introducing sensors and microcontrollers using the well-popular micro:bit platform.
No soldering is required so the kit is perfectly safe for the classroom. The iBIT robot kit
comes with 2 versions :
1. iBIT robot kit Lite. It includes the micro:bit and iBIT controller board. It also
includes simple sensors (touch sensors and infrared reflector sensors), DC motor
gearboxes and many mechanical parts that allow you to make an autonomous robot
suitable for learning of the Microsoft PXT Graphical programming language. This version
is most affordable for beginners in robotics.
2. iBIT robot kit Plus . It also includes all main components that are in the Lite kit
and other extra part such as the Aluminum wheels, Silicone tires, a standard mini servo
motor and extra chasis. With the Plus version, it allows users to learn more about robotics
in education as well as competition.
1.2 micro:bit
micro:bit is a tiny programmable computer, designed to make learning and
teaching easy. Figure 1-1 shows the important details of micro:bit. Summary features are
as follows :
25 individually-programmable LEDs
2 programmable buttons
Physical connection pins
Light and temperature sensors
Motion sensors (accelerometer and compass)
Wireless Communication, via Radio and Bluetooth
USB interface
Main microcontroller is a 32-bit ARM Cortec M0; nRF51822 from Nordic
Semiconductor with 256KB flash memory 10,000 erase/write times and 16KB RAM. Run
with 16MHz crystal
23 I/O with 80-pin edge connector. 1.27mm. pitch. and 5 big pads with 4mm.
pads for supporting alligator clips include P0, P1, P2, +3.3V and Ground. The figure 1-2
shows about micro:bit I/O port pin assignment. Summary are +3.3V (3 pins), GND (3 pins)
and 17 pins for I/O port.
Programmable robot with micro:bit 7
+3.3Vdc switching regulator power supply circuit. Its regulates the supply
voltage for micro:bit and all components
+6Vdc power supply circuit for servo motor output
8-ch analog inputs with 12-bit ADC integrated circuit. Voltage input range 0
to +3.3Vdc. It supports expandable to 32 channels via I2C bus
DC jack input
+4.8V to +9V
Battery terminal
+4.8V to +9V
Gold-plated 4mm.
pads of micro:bit
P0 to P2 pins with
+3.3V and GND
2-wire bus (I2C)
connectors
I/O connector : port 8/12 are shared DC motor output DC motor output
with Servo motor outputs header/terminal indicators
K2
Vin 7-9Vdc K3
K1 ON micro:bit I/O
Q1
Vin
FDS6675
7-9Vdc
KIA7031 40
1
S1 S7V8F3
POWER +3.3V 39 37 35 33 31 29 13 11 9 7 5 3 1
40 38 36 34 32 30 28 14 12 10 8 6 4 2
C2 +
IC1 GND
470F GND
278R06 OUT + SH RS +3V
2 1 16V GND
+Vs Vout Vin
0
C1 GND INH
470F 1
3 4 R1 +Vm
16V LED2 2
1k LOW-BAT. +3V 3 0 4 5 6 7 1 8 9 10 11 12 2 13 14 15 16 19 20 GND
1 K3B
LED1 R3 micro:bit
ON +V I/O
47k
3 13 14 15 16
RESET
R2
1 3 GND 1k
+3.3V Vout Vin
C4 2 IC2 +3.3V
C3 GND SHDN R4
100F 10k KIA7031
0.1F 16V 2 4
MOD1 +3.3V
S7V8F3 R5
4.7k K4 K5 K6 K7 K8 K9 K10
0 1 2 8 12 19 20
R6 AN0 AN1 AN2 SCL SDA
4.7k
+3.3V +Vs
14 15 12 13 9 11
+3.3V K11
SCL SDA A0 A1 GND COM 8-SERVO1
16 IC3
Vcc ADS7828 K12
REF 10 12-SERVO2
C5 AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 C6
10F 1 +3.3V 2 +3.3V 3 +3.3V 4 +3.3V 5 +3.3V 6 +3.3V 7 +3.3V 8 +3.3V 0.1F
50V
s+ s+ s+ s+ s+ s+ s+ s+
+Vm
LED4 K22A
R7 IC4 MOTOR-2 MOTOR-2
4k7 TB6612FNG
+3.3V 13 12
+VM B1
14 11
Q2 15
+VM B1 10 - K22B
+
PWMA A1 MOTOR-1
24 +VM 1
A1
Q3
KRC102 C8 LED3 K21A
13 C9 470F MOTOR-1 MOTOR-1
0.1F 16V
14
5 free I/O ports and assign to 3-pin JST connectors for interfacing with sensors
and peripherals :
- 3 Universal port support Analog input functions and Digital input/output
function; P0, P1 and P2 with gold-plated contacts.
- 2 Digital input/output function; 8 and 12 share with servo motor outputs
I2C bus port; SCL and SDA for extension
The complete schiematic of iBIT controller board is shown in the Figure 1-4.
iBIT controller board also comes with the micro:bit adaptor board. Normally user
can plug the micro:bit board directly to iBIT board with vertical direction. Additional
user possible plug the micro:bit in horizontal direction by using the adaptor board
following the Figure 1-5.
Figure 1-5 Example of pluging the micro:bit board with iBIT controller board
[Left] Vertical direction directly
[Right] Horizontal direction by using the micro:bit adaptor board
(bundled in the kit ready)
Programmable robot with micro:bit 11
Average speed 440 round per minute (RPM) @6V and no load
Attached with the mounting bracket with screw and nut set
LED1
R1
(Default = 510)
+ Q1
S
KRC102
(DTC114)
12 Programmable robot with micro:bit
connector shaft
cable
GND (-)
+Vm
Signal STANDARD
SERVO MOTOR
Body
Torque 1.6kg-cm/21oz-inch
Size in mm. (L x W x H) 32 x 22 x 28
LED1 Indicator +V
R2
10k
R1
510 R3
220 DATA
Signal output
S1
GND
Switch
The switch input is used to detect collision at logic “0”. Two sets along with the
connecting cable are provided.
Programmable robot with micro:bit 13
The suitable distance from sensor to line or floor is during 3 to 8 mm. The output
voltage is during 0.1 to 3V from +3.3V suuply and digital value from12-bit A/D converter
is 800 to 4,000. Thus, ZX-03 will suitable to apply to line tracking sensor.
Signal connector
+V
OUT TCRT5000
GND 510
10k
Infrared Reflector
14 Programmable robot with micro:bit
Weight is 22 grams.
Wheel rim accepts 12mm, 15mm and 16mm diameter micro metal gearbox
motors. Center hole is drilled to 3mm (Which is very common shaft for miniature
gearmotors)
It has an M4 set screw inside, so It holds motor's shaft mechanically and firmly.
The kit includes 2 pairs of the wheel and silicone tire, socket screws and an Allen
wrench.
Chapter 2
Assembly Instructions
2.1 Overview
All parts for assembly the iBIT:Racer robot are shown in the figure 2-1.
(3) Tighten the socket screw into the hole by using the wrench. Then insert the
wheel to the motor shaft.
Programmable robot with micro:bit 21
(4) Tighten the screw to fix the wheel with the motor shaft. Do same for another
wheel and tire set.
(5) Fix the mounting bracket with the micro metal gearbox. Do 2 sets.
(6) Insert the mounting nuts (2mm. nut) into both fixing holes of the mounting.
22 Programmable robot with micro:bit
(7) Place the motor with bracket on the robot chassis at the position following
the photo below.
(8) Insert the mounting screws (2x20mm. screw) to fix the motor with the robot
chassis and tighten it.
(10) String the motor cables through the trapezoid aperture and flip over the
robot chassis. The motor gearbox installation is ready.
(11) Next is ball caster assembly. Prepare the ball caster wheel part. It includes
Ball caster, 2 pieces of pad, 2 sets of the 2x20mm. screw and nut.
2x20mm. screw
(13) Flip the robot chassis. Place the bass caster at the front.
(14) Tighten the ball caster with 2 pieces of 2mm. nuts on the top side of chassis.
Programmable robot with micro:bit 25
(15) Prepare the battery holder part set. It includes a 4AAA battery holder, 2 sets
of 2x20mm. flat head screw and nut.
(16) Place the battery holder at position of the top of robot chassis following the
photo below. Attach with the chassis by using 2 sets of 2x20mm. flat head screw and
nut.
(17) Install the IR reflector sensors. Insert the 3x15mm. screw through the ZX-03
sensor and 3mm. plastic washer. Do 2 sets.
ZX-03 sensor
sensor case
plastic washer
(18) Flip over the robot chassis again. Attach both ZX-03 sensors at the front of the
robot chassis following the photo below by tightening the 3mm. nuts. String the sensor
cables through the trapezoid aperture.
(19) Flip the robot chassis back. Prepare the metal standoffs for fixing at all positions
following the photo.
Programmable robot with micro:bit 27
(20) Insert the standoffs on the top of the robot chassis. Tighten with 3mm. nuts
28 Programmable robot with micro:bit
(21) Place the iBIT controller board over the standoffs. Tighten with 3 of the hand
screws.
(22) For the last standoffs, tighten with a 3x8mm. screw by using the screwdriver.
Programmable robot with micro:bit 29
(23) Plug the terminal header of battery holder to the iBIT board.
(24) Plug the micro:bit to the iBIT board. Make sure plugging correct side. See the
photo for making correctly.
30 Programmable robot with micro:bit
Chapter 3
About micro:bit
introduction and more technical
micro:bit is a tiny programmable computer, designed to make learning and
teaching easy and fun! This chapter introduces and describe some technical information
about micro:bit. The figure 3-1 illustrate about micro:bit’s component that showing more
technical details.
3.1 Overview
micro:bit has the following physical features:
25 individually-programmable LEDs
2 programmable buttons
USB interface
Let’s take a look at what these components do and discover how to code them!
3.1.1 LEDs
The micro:bit has 25 individually-
programmable LEDs, allowing you to display text,
numbers, and images. User can control LED intensity
10 steps.
3.1.2 Buttons
There are two buttons on the front of the
micro:bit (labelled A and B). You can detect when
these buttons are pressed, allowing you to trigger
code on the device.
Programmable robot with micro:bit 33
The edge connector brings out many of the GPIO circuits of the application
processor. Some of these circuits are shared with other functions of the micro:bit, but
many of these extra circuits can be re-allocated to general purpose use if some software
features are turned off. Note: the nRF51 data sheet states that GPIO pins may be in std-
drive (0.5mA) and high-drive (5mA) mode, with a maximum of 3 pins in high-drive mode at
any one time.
Rings
3 large IO rings and two large power rings, 4mm plug and crocodile clip compatible
GPIO features
19 assignable GPIO pins
2 are assigned to the on board I2C interface
6 are used for display or light sensing feature
2 are used for on board button detection
1 is reserved for an accessibility interface
19 may be assigned as digital input or digital output
19 may be assigned for up to 3 simultaneous PWM channels
19 may be assigned for 1 serial transmit and 1 serial receive channel
6 may be assigned as analog input pins with 10-bit ADC resolution (0....1023)
3 may be assigned to an optional SPI communications interface
3 may be assigned for up to 3 simultaneous touch sensing inputs
Pitch
1.27mm, 80 way double sided.
Pads
5 pads, with 4mm holes
34 Programmable robot with micro:bit
3.1.6 Accelerometer
An accelerometer measures the acceleration
of the micro:bit; this component senses when the
micro:bit is moved. It can also detect other actions,
e.g. shake, tilt, and free-fall.
3.1.7 Compass
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.
3.1.8 Radio
The radio feature allows user to communicate
wirelessly between micro:bits. Use the radio to send
messages to other micro:bits, build multiplayer
games, and much more!
3.1.9 Bluetooth
A BLE (Bluetooth Low Energy) antenna allows
the micro:bit to send and receive Bluetooth signals.
This allows the micro:bit to wirelessly communicate
with PCs, Phones, and Tablets, so user can control
the mobile phone from micro:bit and send code
wirelessly to the target device from mobile phone!
The main processor is Nordic nRF51822. It has Flash ROM 256KB, RAM 16KB and run
with 16MHz clock frequency.
Chapter 4
Getting start coding with
micro:bit
micro:bit’s coding is very easy. It can be coded from any web browser in Blocks,
Javascript, Python, Scratch and more; no software required. There are three exmple of
coding tools for micro:bit
https://makecode.microbit.org/#
40 Programmable robot with micro:bit
2. Python Editor
Python editor is perfect for those who want to push their coding skills further. A
selection of snippets and a range of premade images and music give you a helping
hand with your code. Powered by the global Python Community.
(1) Firstly, access to internet. Enter to www.microbit.org. Choose Let’s Code menu.
42 Programmable robot with micro:bit
(2) At the JavaScript Blocks Editor section, click on the Let’s Code button. It redirect
to MakeCode webpage for coding at https://makecode.microbit.org/#
(3) Adding the iBIT block command package. Select Advance > Add Package
from command list on the left menu.
https://github.com/inexglobal/pxt-iBit
(5) iBIT package appears in the command list on the left menu. Try to click on the
iBIT name. All blocks are under the iBIT package will appear
44 Programmable robot with micro:bit
(6) Bookmark this webpage. Try to close web browser. Disconnect internet. Open
web browser again and open the MakeCode web page from bookmark. Now you
can coding with JavaScript Blocks Editor by offline.
4.1.2 Connect it
(1) Connect the micro:bit to the computer via a micro USB cable. Macs, PCs,
Chromebooks and Linux systems (including Raspberry Pi) are all supported.
(2) Your micro:bit will show up on your computer as a drive called ‘MICROBIT’.
Watch out though, it’s not a normal USB disk.
Programmable robot with micro:bit 45
4.1.3 Program It
(1) Using JavaScript Blocks Editor, write the first micro:bit code. Go to menu Basic
then select forever block.
(3) Back to Basic menu again. Select the show leds block.
(4) Drag the show leds block inside the forever block.
(5) Make the heart icon on the show leds block by clicking on any LED in the
show leds block as follows.
Programmable robot with micro:bit 47
(6) Copy the show leds block and drop under forever block. Then create another
heart pattern on the second show leds block to make it blink.
(7) Click the Download button in the editor. This will download a ‘hex’ file, which
is a compact format of your program that your micro:bit can read. You can save as this
hex file to other name.
48 Programmable robot with micro:bit
(8) Once the hex file has downloaded, copy it to your micro:bit just like copying a
file to a USB drive. On Windows you can right click and choose Send To MICROBIT.
Programmable robot with micro:bit 49
(9) The micro:bit will pause and the yellow LED on the back of the micro:bit will
blink while your code is programmed. Once that’s finished the code will run
automatically.
Chapter 5
Operation
with iBIT block package
Coding the iBIT:Racer robot is simple and easy by using the iBIT block package in
micro:bit Javascript Block editor or Microsoft PXT block editor. User can add package
following the steps in Chapter 4.
User must know some information about the hardware connection of iBIT:Racer
robot. The figure 5-1 shows the important details about connection assignment.
(1) Firstly, access to internet. Enter to www.microbit.org. Choose Let’s Code menu.
Programmable robot with micro:bit 53
(2) At the JavaScript Blocks Editor section, click on the Let’s Code button. It redirect
to MakeCode webpage for coding at https://makecode.microbit.org/#
(3) Adding the iBIT block command package. Select Advance > Add Package
from command list on the left menu.
https://github.com/inexglobal/pxt-iBit
(5) iBIT package appears in the command list on the left menu. Try to click on the
iBIT name. All blocks are under the iBIT package will appear
Programmable robot with micro:bit 55
(6) Bookmark this webpage. Try to close web browser. Disconnect internet. Open
web browser again and open the MakeCode web page from bookmark. Now you
can coding with JavaScript Blocks Editor by offline.
Step 2 - Drag and Drop the command block to create the code.
Figure 5-2 How to make code for micro:bit of the iBIT:Racer Robot
Programmable robot with micro:bit 57
This block support each motor outputs with forward / backward direction and
set the speed from 0 to 100% like these :
Programmable robot with micro:bit 59
This block support 2 motor outputs in same time with forward / backward direction
and set the speed from 0 to 100% and stop moving like these :
60 Programmable robot with micro:bit
The pivot point of robot moving is at the center point of the wheel of the motor
which is off. The robot will turn with speed value until the time that user set.
These blocks control 2 motor outputs in same time with turn left / turn right and set
the speed from 0 to 100% like these :
Programmable robot with micro:bit 61
62 Programmable robot with micro:bit
The pivot point of robot moving is at the center point of the robot between both
motors. The robot will turn with speed value until the time that user set.
These blocks control 2 motor outputs in same time with spin left / spin right and set
the speed from 0 to 100% like these :
Programmable robot with micro:bit 63
64 Programmable robot with micro:bit
1. Servo
This block is used to control the movement of servo motor’s shaft position. User
could be select the servo motor output channel and moving angle from 0 to 180 degree.
2. ServoStop
This block is just one operation. It stops the operation of the selected servo motor
output.
User can select the analog input 0 to 7 for reading the sensor values.
Programmable robot with micro:bit 65
5.8.1 Example-1
(1) Create the program following the block code below.
(3) Download the code into micro:bit of the iBIT:Racer robot. Disconnect the
microUSB cable.
5.8.2 Example-2
(1) Create the program following the block code below.
(3) Download the code into micro:bit of the iBIT:Racer robot. Disconnect the
microUSB cable.
(4) Place the robot on the floor. Turn on the POWER switch of the iBIT:Racer robot.
micro:bit shows icon then iBIT:Racer robot continue to moves forward with
40% power speed around 1 seconds and spin left 0.3 second with 40% power speed.
Programmable robot with micro:bit 67
(3) Download the code into micro:bit of the iBIT:Racer robot. Disconnect the
microUSB cable.
(4) Connect a servo motor to Servo Output-1. Insert the servo motor’s horn. Fix it
by tightening the servo motor’s screw.
Caution :
(3) Download the code into micro:bit of the iBIT:Racer robot. Disconnect the
microUSB cable.
(6) Press button-A of micro:bit then observe the micro:bit LED operation.
Now micro:bit reads the sensor’s value from analog input ADC0 and shows
on its LED display. The sensor data from detecting the white surface are high. The value
is during more than 2000.
Programmable robot with micro:bit 69
(7) Press button-B of the micro:bit. then observe the micro:bit LED operation again.
micro:bit reads the sensor’s value from analog input ADC1 and shows on its
LED display.
(8) Stick the black tape on the floor. Place the robot by the sensor position must
over the black tape.
(9) Press button-A of micro:bit then observe the micro:bit LED operation.
micro:bit reads the sensor’s value from analog input ADC0 and shows on its
LED display. The value must low because the sensor detects the black surface. It is
during 0 to 4095. Normally the black surface will be detect data lower 1000
(10) Press button-B of micro:bit. then observe the micro:bit LED operation again.
micro:bit reads the sensor’s value from analog input ADC1 and shows on its
LED display.
User can use these same steps for the Line tracing robot example in the next
chapter.
70 Programmable robot with micro:bit
Programmable robot with micro:bit 71
Chapter 6
The most popular of the education robot activity and learning is Line tracing robot.
iBIT:Racer robot also support and has good performance about this activity. This chapter
describes about how to make code for micro:bit robot to detect the black line and
white surface for making the simple line tracing robot.
Purpose :
1. Press button-A for starting to read the sensor value from ADC0 input to shows
on micro:bit’s LED display. The sensor at ADC0 is the Left IR reflector sensor of iBIT:Racer
robot.
2. Press button-B for starting to read the sensor value from ADC1 input to shows
on micro:bit’s LED display. The sensor at ADC1 is the Right IR reflector sensor of iBIT:Racer
robot.
Procedure :
(1) Create the program following the block code below.
(3) Download the code into micro:bit of the iBIT:Racer robot. Disconnect the
microUSB cable.
72 Programmable robot with micro:bit
(5) First, read value from the white area. Place the robot on the white area.
(6) Next, read value from the black line. Stick the black tape on the floor.
Place the robot by the sensor position must over the black tape.
(7) Get the white area and black line value to calculate the reference value.
For example, the white area value is 2500. The black line value is 500. The
reference value is (the white area value + The black line value) / 2. Result is (2500+500)/
2 = 1500. Finally we get the example reference value of the black line detection is 1500.
Programmable robot with micro:bit 73
Procedure :
(1) Create the program following the block code below.
(3) Download the code into micro:bit of the iBIT:Racer robot. Disconnect the
microUSB cable.
(5) Place the robot over the white surface. See the detection result from micro:bit
LED display.
(6) Place the robot over the black line. See the detection result from micro:bit display.
(2) The dialog box for setting the variable name is appeared. For example, type
left word for create the variable name is left. Then click on the OK button to confirm.
Programmable robot with micro:bit 75
(3) Back to main window, in the Variable block list has a new variable block. It
is left block.
(5) Change the variable by clicking on the variable name and select the target
variable. This is left then the block will be change the variable name to left.
76 Programmable robot with micro:bit
At the main window of Microsoft PXT block editor, click on the Logic list from a
block category on the left hand side of the page. The block of Logic will appear
following the screen short below.
(1.3) Drag and drop the else…if block to connect the if block.
78 Programmable robot with micro:bit
(1.4) Drag and drop the else block to connect the else…if block.
(1.6) If you want to loop checking condition, select to Basic block category then
drag and drop the forever block to cover all if blocks following the screen short below.
Programmable robot with micro:bit 79
(a) Check the first condition. If false, check next condition of else…if block
(b) If condition still is false, code will execute the command at the ending
else block.
or “1”
or “0”
There are six blocks represent comparison operators that yield a Boolean value :
equal
not equal
less than
more than
Procedure :
(1) Create the program following the block code below.
(6) Place the robot over the black line. See the result from micro:bit LED display.
Procedure :
(1) Create the program following the block code below.
(3) Download the code into micro:bit. Disconnect the microUSB cable.
(5) Stick the black line far from the robot’s start point about 1 metre.
(6) Place the robot at the start point. Press the buton-A. Observe the robot’s
operation.
iBIT:Racer robot moves forward with 50% speed. It moves continue until its
both sensors detect the black line. The robot will stop immediately.
Programmable robot with micro:bit 83
1. Both sensors detect the white 2. Only the Left sensor detects
surface. the black line
Result : Robot moves forward over the Result : Robot spins left until both sensors
black line. meet the white surface.
3. Only the Right sensor detects 4. Both sensors detect the black line
the black line Result : Still moves forward over the black
Result : Robot spins right until both sensors line or Stop or Turn left or Turn right depend
meet the white surface. on mission.
84 Programmable robot with micro:bit
Procedure :
(1) Create the program following the block code below.
(3) Download the code into micro:bit of the iBIT:Racer robot. Disconnect the
microUSB cable.
Programmable robot with micro:bit 85
(4) Make the simple black line field following the illustration below. The white
surface area is 90 x 60 cm. and black line width is 1 inches (2.5 cm.)
(5) Place the robot at the start point and over the black line.
iBIT:Racer robot moves along the black line continue. It is possible that the
robot moves out of the line. You can improve the precision by editing the program with
adjusting the sensor reference value and adjust to the position of both infrared reflector
sensors.
When the robot moves over the crossing line, it still moves forward pass the
crossing line.
(8) Try to increase the movement speed to find the maximum speed that the robot
still move along the line completely and not move out from the line.
86 Programmable robot with micro:bit
(1) Select block category Advanced > Functions then select Make a Function.
(5) The created function will add into the menu Function automatically.
(6) Users and developers can use the new function for their code.
88 Programmable robot with micro:bit
1. Cross_Stop - The operation of this function is looping to check both sensors status
and try to control the robot moving along the black line at all times. If the robot detects
the crossing line, it stops immediately.
Programmable robot with micro:bit 89
2. Cross_Left - The operation of this function is looping to check both sensors status
and try to control the robot moving along the black line at all times. If the robot detects
the crossing line, it spins left to change the moving path to left.
2
Both IR Reflector
sensors detect
Robot moves forward the black line.
4 along the black line
continue.
1
Operation of the
Move forward along
Cross_Left function the black line.
90 Programmable robot with micro:bit
Cross_Left function
for iBIT:Racer robot
From creating 2 functions for tracing the black line, you can make the new code
for improving the line tracing robot. The next activity is making the smarter line tracing
robot. It can move along the black line and spins left when detect the first crossing line.
Next, it still move along the line and stop when detect the second crossing line.
Programmable robot with micro:bit 91
Procedure :
(1) Create the program following the block code below.
92 Programmable robot with micro:bit
(3) Download the code into micro:bit of the iBIT:Racer robot. Disconnect the
microUSB cable.
(4) Make the black line arena depend on your design and add 2 crossing lines or
junctions.
(5) Place the robot at the start point and over the black line.
iBIT:Racer robot moves along the black line continue. It spins left to change
direction after detects the first junction then moves straight along the line and stops at
the next junction.
2
Both IR Reflector
sensors detect
the firt junction.
4
Robot moves forward
along the black line
continue until detect
the second junction. 1
It stops immediatly.
Move forward along
the black line.