Case 19: Sweeper
Contents
22. Case 19: Sweeper#
22.1. Purpose#
Build a TPBot sweeper.
22.2. Material#
1 x TPBot
22.3. Hardware Connection#
Connect the 360 degrees servo to servo 1 port on TPBot. (Servos are not included in our TPBot kit)
22.4. Software#
22.5. Programming#
Click “Advanced” in the MakeCode drawer to see more choices.
We need to add a package for programming. Click “Extensions” in the bottom of the drawer and search with “tpbot” to download it.
Sample#
Drag the show icon brick in the on start and set the car to move forward at the speed of 30%; in forever brick, set the servo connecting to S1 rotate to 180 degrees and pause for 1000ms, and set it rotate to 0 degree and pause for 1000ms.
Link#
You may also download it directly below:
Conclusion#
The car move forward with the servo rotating.
22.6. Exploration#
22.7. FAQ#
Q: The car cannot move with the code in this case?
A: It might be a lack power of the battery, please add the value of the parameter for the speed of the car and test it.