# Case 01: Running Control ## Purpose --- - Learn to control the movement of TPBot via programming. ## Materials --- - 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) ## 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) ### Sample A - Drag the brick of setting the speed in both 100 for both wheels of TPBot into the "On Start". ![](./images/TPBot_tianpeng_case_01_04.png) ### Link - Link: [https://makecode.microbit.org/_0r5C5L029L9m](https://makecode.microbit.org/_0r5C5L029L9m) - You may also download it directly below:
### Conclusion - TPBot keeps moving forward. ### Sample B - Drag and set the brick of moving forward at the speed of 100 and lasting for 3 seconds into the "On Start". ![](./images/TPBot_tianpeng_case_01_05.png) ### Link - Link: [https://makecode.microbit.org/_XXH3yP66oRRp](https://makecode.microbit.org/_XXH3yP66oRRp) - You may also download it directly below: ### Conclusion - TPBot moves forward at full speed for 3 seconds and then stops. ### Sample C - Drag and set the brick of moving forward at the speed of 100 into the brick of "while button A being pressed", then set to pause for 2000ms, and drag the stops immediately brick as the pic says. ![](./images/TPBot_tianpeng_case_01_06.png) ### Link - Link: [https://makecode.microbit.org/_6i4awR07MA7E](https://makecode.microbit.org/_6i4awR07MA7E) - You may also download it directly below: ### Conclusion - While button A being pressed, TPBot moves forward at the full speed for two seconds and then stops. ## Exploration --- ## FAQ --- ## Relevant File ---