Case 19: Sweeper
22. Case 19: Sweeper#
Build a TPBot sweeper.
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)
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.
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.
The car move forward with the servo rotating.
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.