Skip to main content

Case 11: Material handling vehicle 2

Case introduction

Design a material handling vehicle.

Teaching Preparation

NameGraphics
Nezha Sport Kit

Teaching objectives

Make a material transporter and complete the specified tasks

Be familiar with the use of four-way patrol sensors

Course introduction

Welcome children to join our wonderful STEAM journey! Today, we will explore how to make a material transporter. Through programming, let the material transporter complete the specified transport tasks. Let us start this exciting STEAM learning journey together and stimulate your creativity and problem-solving ability!

Learning and exploration

Linkage use of multiple servos

Use of four-way patrol sensors

How to use four-way patrol sensors to help the car adjust its driving route

Building steps

Car Assembly Steps

Ball Retrieval Device Assembly Steps

Simple Goal Assembly Steps

Basketball Hoop Assembly Steps

Hardware connection

Connect the four smart motors to the M1, M2, M3, and M4 interfaces of the Nezha Pro expansion board respectively, and connect the four-way patrol sensor to the IIC interface of the Nezha Pro expansion board.

Hardware connection diagram

Four-way patrol sensor - learning mode

The four-way patrol sensor can learn the map background and patrol track (i.e. the black track) by pressing the button on the sensor. Follow the steps below to complete the learning:

①Focus the four-way line patrol sensor probe on the map background area and press the learning button;

②At this time, the 1st to 4th probe indicator lights are lit in reverse order, and the two learning indicators flash alternately;

③When the line patrol probe fill light emits colorful light and flashes at a high frequency, the line patrol probe should be moved back and forth horizontally on the background map and the line patrol track;

④Keep moving back and forth until the line patrol probe fill light stops flashing, and the learning is completed.

Note: When using, the height of the line patrol probe from the ground should be between 8mm and 16mm.

After successful learning, the two learning indicators will go out. When the line patrol probe detects the line patrol track, the corresponding probe indicator light will light up. When learning fails, the hollow circle and solid circle LEDs flash quickly at the same time, and the fill light RGB light goes out.

For more information, please visit: Plant Series Four-way Line Patrol Sensor WIKI

Code Programming

Go to "makecode.microbit.org" and click New Project.

Enter a project name in the pop-up window and click Create.

Click Extension in the code drawer.

In the pop-up interface, enter nezha pro and click the search icon. Click it when the nezha pro software library is displayed. Load the PlanetX software library in the same way.

Sample Program

This program is relatively complex, please view it through the following shared program link.

Program link: https://makecode.microbit.org/_CvogK9RvqWgT

You can also download the program directly from the following webpage.

## Download the program

Use a USB cable to connect PC and micro:bit V2.

After the connection is successful, a drive named MICROBIT will be recognized on the computer.

Click in the lower left corner and select Connect Device.

Click

Click

In the pop-up window, select BBC micro:bit CMSIS-DAP, and then select Connect. At this point, our micro:bit has been successfully connected.

Click Download the program

Case demonstration

Press button A on the micro:bit to make the line-patrol kicking robot start moving from the starting area, adjust its posture and driving route through the black lines on the map, and kick the football to complete the shooting action.

Summary and sharing

Expand your knowledge