Starter Hellobot Basic¶
Starter Hellobot Basic
written by sean base on following books


Chapter0 :프로그램 방법들에 대한 소개¶
온라인 프로그램¶
1.컴퓨터에 USB 케이블로 마이크로비트를 연결해야 한다. 컴퓨터에 연결되면 컴퓨터에 MICROBIT 라는 디스크가 열릴것이다. 그리고 브라우저에서 http://microbit.org/ 열면 된다.
2. 공식 사이트에 들어간후 아래 인터페이스를 볼수 있을것이다.
- "코드만들기"를 클릭하자.
- 다음과 같이 프로그램 모드로 들어간다.
- 확장 패키지를 포함시켜야 한다.
6. 다음 사이트를 넣으면 패키지가 포함된다. https://github.com/lzty634158/HelloBot
- 패키지를 인스톨 하게되면 다음과 같이 Hellobot 패키지가 보인다.
8.다음 처럼 download를 클릭하면 ***.hex 파일이 다운된다.
*.hex 파일을 microbit 디스크에 넣어 주기만 하면 된다.
Chapter 1 :로봇에 LED 불을 켜보자¶
1.Preparation¶
1.You should learn about the position of the colorful lights in the body of hellobot;
2.You should learn about the micro:bit pins connected to the colorful lights in the schematic.
1-1-1 colorful lights on body of hellobot(back)
1-1-2 colorful lights on body of hellobot
We can make different colors of light and brightness by programming.
1-1-3 schematic
1-1-4 Pins of Micro:bit
From the schematic diagram in P1-1-3, you can see that the colorful lights is connected to the P16 of the Micro:bit.
Note:In the bottom layer of the HelloBot package has been set parameter for the user, you can directly drag the colorful lights building blocks.
- Learning goals
The colorful lights is a combination of three colors of red (R), green (G), and blue (B). The controller can control the output and the brightness of each color to achieve a combination of different colors.
HelloBot body possess four colorful lights, this course we will study how to light a colorful light on the body by programming.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
1-1-5 total program
The locations of blocks in the total program are shown in the following figure.
1-1-6
1-1-7
1-1-8
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 1-1-9 to download the program to micro:bit.
1-1-9
5.Phenomenon
After the code is uploaded. You can see that the colorful lamps in the lower right corner of the HelloBot emit red light. In addition, you can also modify the program to choose to light up different lights and emit different colors of lights. As shown in the following figure.
1-1-10
Chapter2 :로봇에 있는 다양한 컬러 빛을 내보자¶
1.Preparation¶
1.You should learn about the position of the colorful lights in the body of hellobot;
2.You should learn about the micro:bit pins connected to the colorful lights in the schematic.
1-2-1 colorful lights on body of hellobot(back)
1-2-2 colorful lights on body of hellobot
We can make different colors of light and brightness by programming.
1-2-3 schematic
1-2-4 Pins of Micro:bit
From the schematic diagram in P1-1-3, you can see that the colorful lights is connected to the P16 of the Micro:bit.
Note:In the bottom layer of the HelloBot package has been set parameter for the user, you can directly drag the colorful lights building blocks.
- Learning goals
In this lesson, we will learn to light up four colorful lamps in turn, the colorful lamps will emit light of different colors.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
1-2-5 total program
The locations of blocks in the total program are shown in the following figure.
1-2-6
1-2-7
1-2-8
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 1-2-9 to download the program to micro:bit.
1-2-9
- Phenomenon
After the code is uploaded. You can see that four colorful lamps are lit up in turn.
1-2-10 1-2-11
1-2-12 1-2-13
Chapter3 :숨쉬는 불빛을 만들어 보자¶
1.Preparation¶
1.You should learn about the position of the colorful lights in the body of hellobot;
2.You should learn about the micro:bit pins connected to the colorful lights in the schematic.
1-3-1 colorful lights on body of hellobot(back)
1-3-2 colorful lights on body of hellobot
We can make different colors of light and brightness by programming.
1-3-3 schematic
1-3-4 Pins of Micro:bit
From the schematic diagram in P1-3-3, you can see that the colorful lights is connected to the P16 of the Micro:bit.
Note:In the bottom layer of the HelloBot package has been set parameter for the user, you can directly drag the colorful lights building blocks.
- Learning goals
In this course, we learns the new game of colorful lamps - breathing lights. Breathing light: the colorful lamps are changed gradually from light to dark by the control of the micro:bit. It feels like a person is breathing.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
1-3-5 total program
The locations of blocks in the total program are shown in the following figure.
1-3-6
1-3-7
1-3-8
1-3-9
1-3-10
1-3-11
1-3-12
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 1-3-13 to download the program to micro:bit.
1-3-13
5.Phenomenon
After the code is uploaded. You can see that the colorful lamps of robot are changed gradually from light to dark by the control of the micro:bit. It feels like a person is breathing. As shown in the following figure.
1-3-14
Chapter4 :로봇 팔의 불빛을 켜보자¶
1.Preparation¶
1.You should learn about the position of the magic lights in the arm of hellobot;
2.You should learn about the principle of touch magic lights;
3.You should learn about the micro:bit pins connected to the magic lights in the schematic.
(a)touch magic lights on the left arm (b)touch magic lights on the right arm
2-1-1touch magic lights on arm of hellobot
The touch magic light is mounted on the two arms of the HelloBot robot, one for each of the left and right arms. The touch magic light is a whole module consisting of a touch module and a colorful water light.
(a)magic lights (b)touch position
2-1-2 touch magic lights module
The touch magic light is connected to the expansion board by a 6PIN gray cable. The left touch magic light is connected to the left interface of the expansion board, and the right touch magic light is connected to the right interface of the expansion board, and the anti-reversing socket is adopted.As shown in the following figure.
2-1-3 about wiring
2-1-4 schematic
2-1-5 Pins of Micro:bit
From the schematic diagram in P2-1-4, you can see that the touch magic lights is connected to the P6, P9 of the Micro:bit.
Note:In the bottom layer of the HelloBot package has been set parameter for the user, you can directly drag the touch magic lights building blocks.
- Learning goals
This course we will study how to light touch magic lights on the body by programming.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
2-1- 6 total program
The locations of blocks in the total program are shown in the following figure.
2-1-7
2-1-8
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 2-1-9 to download the program to micro:bit.
2-1-9
5.Phenomenon
After the code is uploaded. You will see that the magic lights on the robot's arm emit red light.
2-1-10
Chapter5 :로봇팔의 숨쉬는 불빛 만들기¶
1.Preparation¶
1.You should learn about the position of the magic lights in the arm of hellobot;
2.You should learn about the principle of touch magic lights;
3.You should learn about the micro:bit pins connected to the magic lights in the schematic.
(a)touch magic lights on the left arm (b)touch magic lights on the right
arm
2-2-1 touch magic lights on arm of hellobot
The touch magic light is mounted on the two arms of the HelloBot robot, one for each of the left and right arms. The touch magic light is a whole module consisting of a touch module and a colorful water light.
(a)magic lights (b)touch position
2-2-2 touch magic lights module
2-2-3 about wiring
2-2-4 schematic
2-2-5 Pins of Micro:bit
From the schematic diagram in P2-2-4, you can see that the touch magic lights is connected to the P6, P9 of the Micro:bit.
Note:In the bottom layer of the HelloBot package has been set parameter for the user, you can directly drag the touch magic lights building blocks.
- Learning goals
In this course, we learns the new game of touch magic lights - breathing lights. Breathing light: the touch magic lights are changed gradually from light to dark by the control of the micro:bit. It feels like a person is breathing.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
2-2-6 total program
The locations of blocks in the total program are shown in the following figure.
2-2-7
2-2-8
2-2-9
2-2-10
2-2-11
2-2-12
2-2-13
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 2-2-14 to download the program to micro:bit.
2-2-14
5.Phenomenon
After the code is uploaded. You can see that the colorful lamps of robot are changed gradually from light to dark by the control of the micro:bit. It feels like a person is breathing. As shown in the following figure.
2-2-15
Chapter6 :로봇팔의 터치로 동작되는 불빛 만들기¶
1.Preparation¶
1.You should learn about the position of the magic lights in the arm of hellobot;
2.You should learn about the principle of touch magic lights;
3.You should learn about the micro:bit pins connected to the magic lights in the schematic.
(a)touch magic lights on the left arm (b)touch magic lights on the right
arm
3-1-1 touch magic lights on arm of hellobot
The touch magic light is mounted on the two arms of the HelloBot robot, one for each of the left and right arms. The touch magic light is a whole module consisting of a touch module and a colorful water light.
(a)magic lights (b)touch position
3-1-2 touch magic lights module
3-1-3 about wiring
3-1-4 schematic
3-1-5 Pins of Micro:bit
From the schematic diagram in P3-1-5, you can see that the touch magic lights is connected to the P6, P9 of the Micro:bit. And touch key is connected to the P7, P10 of the Micro:bit.
Note:In the bottom layer of the HelloBot package has been set parameter for the user, you can directly drag the touch magic lights building blocks.
- Learning goals
In this course, we learns how to control touch magic lights by touch key.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
3-1-6 total program
The locations of blocks in the total program are shown in the following figure.
3-1-7
3-1-8
3-1-9
3-1-11
3-1-12
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 3-1-13 to download the program to micro:bit.
3-1-13
5.Phenomenon
After the code is uploaded. You need to put your hand on the touch switch and
you will see that the magic light on the arm will switch color all the time. When
the hand remove, the magic light will always show the color displayed when
the hand leaves, until you touch it again.
3-1-14
Chapter7 :부저¶
1.Preparation¶
1.You should learn about the position of the buzzer in the body of hellobot;
3.You should learn about the micro:bit pins connected to the buzzer in the schematic.
4-1-1 buzzer on arm of hellobot
4-1-2 schematic
4-1-3 Pins of Micro:bit
From the schematic diagram in P4-1-3, you can see that the touch magic lights is connected to the P0 of the Micro:bit. You can use the blocks of music directly.
- Learning goals
In this course, we will study how to make HelloBot robot sing “Happy Birthday”
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
4-1-4 total program
The locations of blocks in the total program are shown in the following figure.
4-1-5
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 4-1-6 to download the program to micro:bit.
4-1-6
5.Phenomenon
After the code is uploaded. HelloBot robot will sing “Happy Birthday”.
Chapter8 :팔 흔들기¶
1.Preparation¶
1.You should learn about the position of the servos in the body of hellobot;
2.You should learn how to drive the servos with the PCA9685PW.
5-1-1 servos on arm of hellobot
Tow servos is the robot's joint, which is mounted on the two arms of the HelloBot. You can control servos rotate degree to control arms.
5-1-2 about wiring
You need to look forward from the back of the robot, the left servo is connected to the J3 interface, and the right servo is connected to the J2 interface. The brown line of the servo corresponds to GND, the red line corresponds to VCC, and the yellow line corresponds to IO.
5-1-3 schematic of servo
5-1-4 schematic of PCA9685PW
5-1-5 Pins of Micro:bit
From the schematic diagram in P5-1-3,P5-1-4.You can see that left servo is connected to s1 of PCA9685PW,right servo is connected to s2 of PCA9685PW.
PCA9685PW is a 16-bit LED controller with IIC bus interface. Each LED can output 12-bit resolution (4096 levels) fixed-frequency independent PWM. It only needs to write the corresponding PWM register value, S1 and S2 interface will output PWM signal to drives the servo.
(You need to look forward from the back of the robot to distinguish between left and right.)
Note:In the bottom layer of the HelloBot package has been set parameter for the user, you can directly drag the arm building blocks.
- Learning goals
In this course, we will learn how to control arm by driving servo. When you touch left arm of HelloBot, left arm of HelloBot will go up.When you tuoch right arm of HelloBot, right arm of HelloBot will go down.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
5-1-6 total program
The locations of blocks in the total program are shown in the following figure.
5-1-7
5-1-8
5-1-9
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 5-1-10 to download the program to micro:bit.
5-1-10
5.Phenomenon
After the code is uploaded. When you touch left arm of HelloBot, left arm of HelloBot will go up.When you tuoch right arm of HelloBot, right arm of HelloBot will go down.
(a)touch left arm (b)left arm go up (c)left arm go down
(d)touch right arm (e)right arm go up (f)right arm go down
5-1-11
Chapter9 :헬로봇 더 다루기¶
1.Preparation¶
1.You should learn about the position of the motors in the body of hellobot;
2.You should learn how to drive the motors with the PCA9685PW.
(a)Left motor on the hellobot (b)Right motor on the hellobot
6-1-1 tow motors
The HelloBot robot uses two yellow TT DC gear motors, and the rotation of the motor drives the wheel forward. The motor on the left is connected to the left side of the expansion board, and the motor on the right is connected to the right side of the expansion board.
6-1-2 schematic of motor drive
6-1-3 schematic of PCA9685PW
6-1-4 Pins of Micro:bit
From the schematic diagram in P6-1-3,P6-1-4.You can see that tow motors is connected to LINA(12)、LINB(13)、RINA(14)、RINB(15) of PCA9685PW.
PCA9685PW is a 16-bit LED controller with IIC bus interface. Each LED can output 12-bit resolution (4096 levels) fixed-frequency independent PWM.
To advance the robot, it is only necessary to make LINA (12) output high level, LINB (13) output low level, RINA (14) output high level, RINB (15) output low level. PCA9685PW connects micro:bit P19 and P20 pins for I2C communication.
Note:In the bottom layer of the HelloBot package has been set parameter for the user, you can directly drag the car control building blocks.
- Learning goals
In this course, we will learn how to make HelloBot robot advance.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
6-1-5 total program
The locations of blocks in the total program are shown in the following figure.
6-1-6
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 6-1-7 to download the program to micro:bit.
6-1-7
5.Phenomenon
After the code is uploaded. The car will advance.
6-1-8
Chapter10 :헬로봇 춤추고 팔 흔들기¶
1.Preparation¶
1.You should learn about the position of the motors in the body of hellobot;
2.You should learn about the principle of the motors.
3.You should learn how to drive the motors with the PCA9685PW.
(a)Left motor on the hellobot (b)Right motor on the hellobot
6-2-1 two motors
The HelloBot robot uses two yellow TT DC gear motors, and the rotation of the motor drives the wheel forward. The motor on the left is connected to the left side of the expansion board, and the motor on the right is connected to the right side of the expansion board.
6-2-2 servos on arm of hellobot
Tow servos is the robot's joint, which is mounted on the two arms of the HelloBot. You can control servos rotate degree to control arms.
6-2-3 buzzer on arm of hellobot
You need to look forward from the back of the robot, the left servo is connected to the J3 interface, and the right servo is connected to the J2 interface. The brown line of the servo corresponds to GND, the red line corresponds to VCC, and the yellow line corresponds to IO.
6-2-4 schematic of servo
6-2-5 schematic of motor drive
6-2-6 schematic of buzzer
6-2-7 schematic of PCA9685PW
6-2-8 Pins of Micro:bit
From the schematic diagram. You can see that tow motors is connected to LINA(12)、LINB(13)、RINA(14)、RINB(15) of PCA9685PW.
PCA9685PW is a 16-bit LED controller with IIC bus interface. Each LED can output 12-bit resolution (4096 levels) fixed-frequency independent PWM.
- Learning goals
In this course, we will learn how to make HelloBot robot advance, back, turn left, turn right, arm swing, sing, dance.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
6-2-9 total program
The locations of blocks in the total program are shown in the following figure.
6-2-10
6-2-11
6-2-12
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 6-2-13 to download the program to micro:bit.
6-2-13
5.Phenomenon
After the code is uploaded. HelloBot start to play music, and advance, back, turn left, turn right, arm swing.
6-2-14
Chapter11 :추적에 따른 불빛 보이기¶
1.Preparation¶
1.You should learn about the position of the RGB tracking obstacle avoidance 3 in 1 module in the body of hellobot;
2.You should learn about the principle of the tracking.
7-1-1 RGB tracking obstacle avoidance 3 in 1 module
7-1-2 RJ45 interface of RGB tracking obstacle avoidance 3 in 1 module
- Back of module (c) Front of module
7-1-3 RGB tracking obstacle avoidance 3 in 1 module
7-1-4 RJ45 interface and cable
The RGB tracking obstacle avoidance 3 in 1 module is installed under the robot arm of the HelloBot, and we need to use the network cable to connect the RGB tracking obstacle avoidance 3 in 1 module.
7-1-5 schematic
7-1-6 Pins of Micro:bit
From the schematic diagram. You can see that left probe is connected to P1 of Micro:bit, right probe is connected to P1 of Micro:bit, colorful lights is connected to P5 of Micro:bit.
Principle of tracking: The basic principle of the infrared tracking sensor is to take advantage of the reflective nature of the object. When the infrared light is emitted onto the black line, it will be absorbed by the black line, but when the infrared light is emitted onto the other colors line, it will be reflected onto the infrared receiver pin. When the car's tracking module detect the black line, the indicator light is light up, and when the white object was detected, the indicator light is light out.
According to this, we write the corresponding code to make the car complete tracking function.
Note:The tracking sensor is not working properly due to the interference of outdoor light. This course needs to be carried out indoors and the curtains are covered to block the outdoor light.
- Learning goals
In this course, we will learn how to make tracking module detect the black line, the colorful lights are green, and when the white object was detected, the colorful lights are red.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
7-1-7 total program
The locations of blocks in the total program are shown in the following figure.
7-1-8
7-1-9
7-1-10
7-1-11
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 7-1-11 to download the program to micro:bit.
7-1-12
5.Phenomenon
After the code is uploaded.
When the tracking probe of HellBot on the white material, you can see that the indicator light on the module is off, and the colorful lights is red.
When the tracking probe of HelloBot on the black material, you see that the indicator light on the module is on, and the colorful lights is green.
When the left tracking probe of HelloBot on the black material, you see that the left indicator light on the module is on, and the colorful lights is green.
When the right tracking probe of HelloBot on the black material, you see that the right indicator light on the module is on, and the colorful lights is green.
7-1-13 The tracking probe on the white material
7-1-14 The tracking probe on the black material
7-1-15 The left tracking probe on the black material
7-1-16 The right tracking probe on the black material
Chapter12 :헬로봇 추척하기¶
1.Preparation¶
1.You should learn about the position of the RGB tracking obstacle avoidance 3 in 1 module in the body of hellobot;
2.You should learn about the principle of the tracking.
7-2-1 RGB tracking obstacle avoidance 3 in 1 module
7-2-2 RJ45 interface of RGB tracking obstacle avoidance 3 in 1 module
- Back of module (c) Front of module
7-2-3 RGB tracking obstacle avoidance 3 in 1 module
7-2-4 RJ45 interface and cable
The RGB tracking obstacle avoidance 3 in 1 module is installed under the robot arm of the HelloBot, and we need to use the network cable to connect the RGB tracking obstacle avoidance 3 in 1 module.
7-2-5 schematic
7-2-6 Pins of Micro:bit
From the schematic diagram. You can see that left probe is connected to P1 of Micro:bit, right probe is connected to P1 of Micro:bit, colorful lights is connected to P5 of Micro:bit.
Principle of tracking: The basic principle of the infrared tracking sensor is to take advantage of the reflective nature of the object. When the infrared light is emitted onto the black line, it will be absorbed by the black line, but when the infrared light is emitted onto the other colors line, it will be reflected onto the infrared receiver pin. When the car's tracking module detect the black line, the indicator light is light up, and when the white object was detected, the indicator light is light out.
According to this, we write the corresponding code to make the car complete tracking function.
Note:The tracking sensor is not working properly due to the interference of outdoor light. This course needs to be carried out indoors and the curtains are covered to block the outdoor light.
2.Learning goals
In this experiment, we need the effect that the robot car walk along the black line.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
7-2-7 total program
The locations of blocks in the total program are shown in the following figure.
7-2-10
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 7-2-11 to download the program to micro:bit.
7-2-11
5.Phenomenon
After the code is uploaded. We will see that the HelloBot walk along the black line.
7-2-12
Chapter13 :초음파 거리재기¶
1.Preparation¶
1.You should learn about the position of the Ultrasonic module in the body of hellobot;
2.You should learn about the principle of the Ultrasonic module.
8-1-1 position of Ultrasonic module 8-1-2 position of wiring
Both the ultrasonic interface and the expansion board interface are designed with anti-reverse connection. The ultrasonic module is connected to the left side of the expansion board by the 4Pin cable.
8-1-3 schematic of ultrasonic module
8-1-4 Pins of Micro:bit
From the schematic diagram. You can see that Pin _Trig of ultrasonic module(SCL) is connected to P14 of Micro:bit, Pin_Echo of ultrasonic module(SDA) connected to P15 of Micro:bit.
Principle of ultrasonic module:
1)The ultrasonic module is a sensor that uses ultrasonic characteristics to detect the distance. It has two ultrasonic probes for transmitting and receiving ultrasonic waves. The range of measurement is 3-450 cm.
2)You need to input a high level signal of at least 10us to the Trig pin to trigger the ranging function of the ultrasonic module.
3)After the ranging function is triggered, the module will automatically send out 8 ultrasonic pulses with 40 kHz and automatically detect whether there is a signal return. This step is done internally by the module.
4)When the module detects an echo signal, the ECHO pin will output a high level. The high level duration is the time from when the ultrasonic wave is sent to when it returns. You can calculate the distance by using the time function to calculate the high level duration.
**Formula: Distance = High level duration * Speed of sound(340M/S)/2. **
2.Learning goals
In this course, we will learn how to measure distance by ultrasonic module,and display distance on Micro:bit dot matrix.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
8-1-5 total program
The locations of blocks in the total program are shown in the following figure.
8-1-6
8-1-7
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 8-1-8 to download the program to micro:bit.
8-1-8
5.Phenomenon
After the code is uploaded. You can see the distance measured by the ultrasonic module on the dot matrix. As shown in the following figure.
(Note:Since the expansion board uses multiple pins, there will be some influence between the pins, which will cause the number displayed on the dot matrix to be somewhat defective. This is normal phenomenon.)
8-1-9
Chapter14 :회피와 초음파 사용하기¶
1.Preparation¶
1.You should learn about the position of the Ultrasonic module in the body of hellobot;
2.You should learn about the principle of the Ultrasonic module.
8-2-1 position of Ultrasonic module 8-2-2 position of wiring
Both the ultrasonic interface and the expansion board interface are designed with anti-reverse connection. The ultrasonic module is connected to the left side of the expansion board by the 4Pin cable.
8-2-3 schematic of ultrasonic module
8-2-4 schematic of motor drive
8-2-5 schematic of PCA9685PW
8-2-6 Pins of Micro:bit
From the schematic diagram. You can see that Pin _Trig of ultrasonic module(SCL) is connected to P14 of Micro:bit, Pin_Echo of ultrasonic module(SDA) connected to P15 of Micro:bit.
PCA9685PW connects micro:bit P19 and P20 pins for I2C communication.
Principle of ultrasonic module:
1)The ultrasonic module is a sensor that uses ultrasonic characteristics to detect the distance. It has two ultrasonic probes for transmitting and receiving ultrasonic waves. The range of measurement is 3-450 cm.
2)You need to input a high level signal of at least 10us to the Trig pin to trigger the ranging function of the ultrasonic module.
3)After the ranging function is triggered, the module will automatically send out 8 ultrasonic pulses with 40 kHz and automatically detect whether there is a signal return. This step is done internally by the module.
4)When the module detects an echo signal, the ECHO pin will output a high level. The high level duration is the time from when the ultrasonic wave is sent to when it returns. You can calculate the distance by using the time function to calculate the high level duration.
**Formula: Distance = High level duration * Speed of sound(340M/S)/2. **
2.Learning goals
When the HelloBot robot in a paper box circle. When the robot detects an obstacle in front, it will turn left to avoid the obstacle.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
8-2-7 total program
The locations of blocks in the total program are shown in the following figure.
8-2-8
8-2-9
8-2-10
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in 8-2-11 to download the program to micro:bit.
8-2-11
5.Phenomenon
After the code is uploaded. When the HelloBot robot in a paper box circle. When the robot detects an obstacle in front, it will turn left to avoid the obstacle.
8-2-13
Chapter15 :회피와 IR센서¶
1.Preparation¶
1.You should learn about the position of the infrared module in the body of hellobot;
2.You should learn about the principle of the infrared obstacle avoidance.
9-1-1 position of infrared module
9-1-2 RJ45 interface of RGB tracking obstacle avoidance 3 in 1 module
- infrared obstacle avoidance probe
9-1-2 RGB tracking obstacle avoidance 3 in 1 module
When there is an obstacle in front, indicator light is on, when there is not an obstacle in front, indicator light is off.
9-1-3 about wiring
The RGB tracking obstacle avoidance 3 in 1 module is installed under the robot arm of the HelloBot, and we need to use the network cable to connect the RGB tracking obstacle avoidance 3 in 1 module.
9-1-4 schematic
9-1-5 schematic of motor drive
9-1-6 schematic of PCA9685PW
9-1-7 Pins of Micro:bit
From the schematic diagram. You can see that Pin _Trig of ultrasonic module(SCL) is connected to P3 of Micro:bit, Pin_Echo of ultrasonic module(SDA) connected to P4 of Micro:bit.
PCA9685PW connects micro:bit P19 and P20 pins for I2C communication.
Principle of infrared obstacle avoidance:
The basic principle of the infrared sensor to avoid obstacles is to use the reflective nature of the object. Within a certain range, if there is an obstacle, the infrared rays will encounter obstacle and will be reflected to reach the sensor receiving pin.
Note:The infrared obstacle avoidance sensor is not working properly due to the interference of outdoor light. This course needs to be carried out indoors and the curtains are covered to block the outdoor light.
2.Learning goals
In this experiment, we will study how to make HelloBot realize infrared obstacle avoidance function.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
9-1-8 total program
The locations of blocks in the total program are shown in the following figure.
9-1-9
9-1-10
9-1-11
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 9-1-11 to download the program to micro:bit.
9-1-12
5.Phenomenon
After the code is uploaded. You can see that if there is an obstacle in front of the robot, the robot will turn right in place to avoid the obstacle; if there is an obstacle in the left front of the robot, the robot will turn right in place to avoid the obstacle; if there is an obstacle in the right front of the robot, the robot will turn left in place to avoid the obstacle.
9-1-13
Chapter16 :회피와 따라가기¶
1.Preparation¶
1.You should learn about the position of the infrared module in the body of hellobot;
2.You should learn about the principle of the infrared obstacle avoidance.
9-2-1 position of infrared module
9-2-2 RJ45 interface of RGB tracking obstacle avoidance 3 in 1 module
- infrared obstacle avoidance probe
9-2-2 RGB tracking obstacle avoidance 3 in 1 module
When there is an obstacle in front, indicator light is on, when there is not an obstacle in front, indicator light is off.
9-2-3 about wiring
The RGB tracking obstacle avoidance 3 in 1 module is installed under the robot arm of the HelloBot, and we need to use the network cable to connect the RGB tracking obstacle avoidance 3 in 1 module.
9-2-4 schematic
9-2-5 schematic of motor drive
9-2-6 schematic of PCA9685PW
9-2-7 Pins of Micro:bit
From the schematic diagram. You can see that Pin _Trig of ultrasonic module(SCL) is connected to P3 of Micro:bit, Pin_Echo of ultrasonic module(SDA) connected to P4 of Micro:bit.
PCA9685PW connects micro:bit P19 and P20 pins for I2C communication.
Principle of infrared obstacle avoidance:
The basic principle of the infrared sensor to avoid obstacles is to use the reflective nature of the object. Within a certain range, if there is an obstacle, the infrared rays will encounter obstacle and will be reflected to reach the sensor receiving pin.
Note:The infrared obstacle avoidance sensor is not working properly due to the interference of outdoor light. This course needs to be carried out indoors and the curtains are covered to block the outdoor light.
2.Learning goals
You need to put the HelloBot robot in a spacious field, use the paper or hand to block the infrared sensor in front, the indicator light is off, and the robot follows the object in front. When only the object is detected on the left side, the left indicator light is off, and the robot turn left in place to follow the obstacle. When only the object is detected on the right side, the light on the right side is off, and the turn right in place to follow the obstacle. When there is no object in front, the indicator light is on and the car stop.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
9-2-8 total program
The locations of blocks in the total program are shown in the following figure.
9-2-9
9-2-10
9-2-11
9-2-12
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 9-2-13 to download the program to micro:bit.
9-2-13
5.Phenomenon
You need to put the HelloBot robot in a spacious field, use the paper or hand to block the infrared sensor in front, the indicator light is off, and the robot follows the object in front. When only the object is detected on the left side, the left indicator light is off, and the robot turn left in place to follow the obstacle. When only the object is detected on the right side, the light on the right side is off, and the turn right in place to follow the obstacle. When there is no object in front, the indicator light is on and the car stop.
9-2-14
Chapter17 :IR 리모트 컨트롤¶
1.Preparation¶
1.You should learn about the position of the infrared receiver in the body of hellobot;
2.You should learn about the principle of the infrared infrared receiver.
10-1-1 position of the infrared receiver in the body of hellobot
The infrared receiver is integrated on the left side of the expansion board. When you use the infrared remote controller, the remote controller needs to be aligned with the infrared receiver to receive the signal and perform corresponding actions.
10-1-2 schematic
10-1-3 Pins of Micro:bit
From the schematic diagram. You can see that infrared receiver is connected to P8 of Micro:bit. Therefore, in the program, it is necessary to initialize the infrared receiving pin, and then you can write the program to set the action corresponding to the key value of the infrared remote control.
Infrared remote control principle:
The infrared remote control emits modulated infrared light waves; the infrared receiver receives the infrared signals and converts them into corresponding electrical signals, which are then sent to the post amplifier. In this experiment, we used an infrared remote controller to control the movement of the car.
Note:The infrared obstacle avoidance sensor is not working properly due to the interference of outdoor light. This course needs to be carried out indoors and the curtains are covered to block the outdoor light.
10-1-4 Infrared remote control code value
// 00FF00FF red_colorful lights
// 00FF30CF blue_colorful lights
// 00FF708F purple_colorful lights
// 00FF40BF green_colorful lights
// 00FF10EF turn left in place
// 00FF50AF turn right in place
// 00FFB04F 0 sing
// 00FF08F7 1 green_arm colorful lights
// 00FF8877 2 red_arm colorful lights
// 00FF48B7 3 yellow_arm colorful lights
// 00FF28D7 4 Control the servo rotation of J2 interface
// 00FFA857 5 white_arm colorful lights
// 00FF6897 6 Control the servo rotation of J3 interface
// 00FF18E7 7 Control the servo rotation of J2 interface
// 00FF9867 8 blue_arm colorful lights
// 00FF58A7 9 Control the servo rotation of J3 interface
2.Learning goals
In this course, we will study how to control car by infrared controller.
3.Programming
3.1 Programming online
1) You should use the USB cable to connect the micro:bit to the computer, at this point, the computer will have a micro:bit U disk. You need to open it, click micro:bit website, then entered the micro:bit website or you can enter the URL directly in your browser: http://microbit.org/
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
3.2 Programming offline
- You can double-click to use it. As shown in the following figure.
2) After entering the programming interface, you need to click Add package and copy the HelloBot package URL: https://github.com/lzty634158/HelloBot to the input field, click to confirm the add package. Then you can use the blocks of the HelloBot package.
Note: The package only needs to be added once. If you have added packages in the previous lessons, this course does not need to be added repeatedly.
10-1-5 total program
The locations of blocks in the total program are shown in the following figure.
10-1-6
10-1-7
10-1-8
10-1-9
4.Download programming
You need to make sure that the micro:bit development board is connected to the computer. Then you should click on the download in the lower left corner as shown in P 10-1-10 to download the program to micro:bit.
10-1-10
5.Phenomenon
After the code is uploaded. You can control HelloBot by infrared remote
controller. When you press and “2” key, colorful lights and
arm color lights are become red. When you press
and “5” key,
colorful lights are become blue and arm color lights are become green.
As shown in the following figure. (Just for example)
10-1-11
Chapter18 :블루투스 리모트 컨트롤¶
Case1: If your HelloBot is a Basic version HelloBot robot, you need to download the Bluetooth program [Basic version Bluetooth control];
Case2: If your car is a Clip version HelloBot robot, please download the Bluetooth program **[Clip version Bluetooth control]; **
Case3: If your car is a Lift version HelloBot robot, please download the Bluetooth program **[Lift version Bluetooth control]. **
(1)At this time, you should open the mobile phone Bluetooth and open the application [HelloBot], if prompted some message please click [Allow], otherwise you will not be able to use this application. As shown in the following figure.
Bluetooth is automatically connected when the Mobile phone is near the robot. The indicator light of the Bluetooth module is not flashing after the connection is successful. As shown in the following figure.
(2)After successful connection,enter the main control page.
Part 1:
Part 2:
Part 3:
(2)--1 Mesh
When multiple HelloBot cars download the Bluetooth program, click “join team” to enter the formation. All the colorful lights of the car are green, indicating that the formation is successful. You can directly control the car to complete some actions, or you can directly click “exit team” to leave the formation.
- --2 Control
When controlling, you can choose three versions:
clamp(clip version),forklift(lift version),arm(Basic version).
(2)--3 Music
(2)--3 Draw Line
(3)Mode choice