# Case 09: Seeking light ## Purpose --- - Programme to set the TPBot heading to the light. ## 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) ## 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 - Set the headlights in white in the on start brick. - Judge if the light intensity is over the set point in the forever brick, if yes, set the TPBot moving forward; or it goes around in circles. ![](./images/TPBot_tianpeng_case_09_04.png) ### Link - Link: [https://makecode.microbit.org/_by81v67kf8Ef](https://makecode.microbit.org/_by81v67kf8Ef) - You may also download it directly below:
### Conclusion - Power up to set the TPBot going around in circles or moving forward if the detected light intensity is over the set point. ## Exploration --- ## FAQ --- Q: The car does not work with the code in the wiki. A: It should be the batteries that are lack of power, please try to fix it by adding the value of the speed in the code. ## Relevant File ---