Case15: Speed Adjustable TPBot
Contents
18. Case15: Speed Adjustable TPBot#
18.1. Purpose#
Adjust the speed of the TPBot with the potentiometer.
18.2. Material#
1 x TPBot
18.3. Hardware connection#
Connect potentiometer to port 1 on TPBot.
18.4. Software#
18.5. Programming#
Click “Advanced” to see more choices in the MakeCode drawer.
We need to add a package for programming. Click “Extensions” in the bottom of the drawer and search with “tpbot” in the dialogue box to download it.
We need to add a package for programming. Click “Extensions” in the bottom of the drawer and seach with “PlanetX” in the dialogue box to download it.
Sample#
Drag the show icon brick into on start.
In forever brick, map the returned value of the potentiometer from 0~1023 to 0~100, and set the mapping value as the speed for the car to move forward.
Link#
You may also download it directly below:
Conclusion#
After powering on, the speed of the TPBot could be adjusted by the potentioneter.
18.6. Exploration#
18.7. FAQ#
Q: While operating this case, why the car might not work properly?
A: It might be the low power of the batteries, please try adding the value of TPBot’s speed and test again.