Robot Kit for Micro:bit Tutorial: 6.7 Tracking
!Note:In order to avoid the interference of sunlight on infrared sensor, we need to carry out this experiment indoors.
1.Preparation
1-1.The position of the tracking sensor module in the robot
In the picture shown below, the tracking module with red wire frame
1-2 Learn about the principle of tracking module
The basic principle of the tracking sensor is to use the reflective nature of the object.
Our experiment is to tracking the black line. When the infrared light is emitted to the black line, it will be absorbed by the black line. When the infrared light is emitted to the other color line, it will reflected to the infrared receiver tube.
Programming method:
Mode 1 online programming: First, we need to connect the micro:bit to the computer by USB cable. The computer will pop up a USB flash drive and click on the URL in the USB flash drive: http://microbit.org/ to enter the programming interface. Add the Yahboom package: https://github.com/lzty634158/Tiny-bit to program.
Mode 2 offline programming: We need to open the offline programming software. After the installation is complete, enter the programming interface, click【New Project】, add Yahboom package: https://github.com/lzty634158/Tiny-bit, you can program.
In the picture shown below, the ultrasonic module with red wire frame.
2.Learning goal
2-1. Learn how to use line sensor graphically program building blocks and control motor graphically program building blocks.
2-2. The function is realized by programming: the robot car advance along black track.
3.Search for block
The following is the location of the building blocks required for this programming.
4.Combine block
The summary program is shown below:
5.Experimental phenomena
After the prgram is downloaded, open the power of the robot car, it will advance along the black track and a heart will be display on the micro:bit dot matrix.
The code of the experiment: 7.Tracking.rar
Playing with Tiny bit
- Robot Kit for Micro:bit Tutorial 6.1 Measuring worker
- Robot Kit for Micro:bit Tutorial 6.2 Distance control light
- Robot Kit for Micro:bit Tutorial: 6.3 Ultrasonic obstacle avoidance
- Robot Kit for Micro:bit Tutorial 6.4 Magic hand
- Robot Kit for Micro:bit Tutorial: 6.5 Radar detector
- Robot Kit for Micro:bit Tutorial 6.6 Playing black paino
- Robot Kit for Micro:bit Tutorial: 6.7 Tracking
- Robot Kit for Micro:bit Tutorial: 6.8 Voice control light
- Robot Kit for Micro:bit Tutorial 6.9 Coward
- Robot Kit for Micro:bit Tutorial: 6.10 Musical rhythm
- Robot Kit for Micro:bit Tutorial: 6.11 Listener
- Robot Kit for Micro:bit 6.12 Wobble when touch
- Robot Kit for Micro:bit Tutorial: 6.13 Spinning top
- Robot Kit for Micro:bit Tutorial: 6.14 Frog beating
- Robot Kit for Micro:bit Tutorial: 6.15 Adventure car