Skip to main content

Obstacles Clearance Car

Purpose

To create an obstacle clerance TPBot car.

Materials Requested

TPBot Smart Car

360 degrees servo

Bricks Pack

Assembly Steps

Hardware Connections

Connect the 360° servo to servo 1 port on the TPBot.

Software

Microsoft makecode

Program

Click "Advanced" in the makecode drawer to see more choices.

For programming the TPBot, we need to add the extensions. Click "Extensions" at the bottom of the drawer and search with tpbot in the box, then download it.

Samples

While on start, set to show an icon and make the car drive forward at the speed of 30%; in forever block, set the servo connecting with S1 to ratote to 180 degrees, then pause for 1000ms, set that servo to 0 degree, and pause 1000ms.

Program

Reference link: https://makecode.microbit.org/_CAXezWdyX0Mm

You may download it directly here:

Conclusion

The cart moves forward and the servo continues rotating in different directions.