# Case15: Speed Adjustable TPBot ## Purpose --- - Adjust the speed of the TPBot with the potentiometer. ## Material --- - 1 x [TPBot](https://shop.elecfreaks.com/products/elecfreaks-micro-bit-tpbot-car-kit-without-micro-bit-board?_pos=1&_sid=f32828112&_ss=r) ![](./images/TPBot_tianpeng_case_01_01.png) ## Hardware connection --- Connect potentiometer to port 1 on TPBot. ![](./images/TPBot_tianpeng_case_15_02.png) ## Software --- [MicroSoftmakecode](https://makecode.microbit.org/#) ## Programming --- Click "Advanced" to see more choices in the MakeCode drawer. ![](./images/TPBot_tianpeng_case_01_02.png) - 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. ![](./images/TPBot_tianpeng_case_01_03.png) - 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. ![](./images/TPBot_tianpeng_case_15_03.png) ### 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. ![](./images/TPBot_tianpeng_case_15_04.png) ### Link - Linkļ¼š[https://makecode.microbit.org/_ArRM71PD6de0](https://makecode.microbit.org/_ArRM71PD6de0) - You may also download it directly below:
### Conclusion - After powering on, the speed of the TPBot could be adjusted by the potentioneter. ## Exploration --- ## 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. ## Relevant File ---