13. Case 12: micro:bit Remote Control

13.1. Purpose


  • Programme to use the mciro:bit to control the TPBot.

13.2. Material


../../_images/TPBot_tianpeng_case_01_01.png

13.3. Software


MicroSoftmakecode

13.4. 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 seach with “tpbot” in the dialogue box to download it.

../../_images/TPBot_tianpeng_case_01_03.png

##Sample

Remote Control Part

  • Set the micro:bit showing a set icon and the radio group as 1.

  • After pressing button A, radio send number 1; after pressing button B, radio send number 2; after pressing button A+B, radio send number 3.

../../_images/TPBot_tianpeng_case_12_04.png

Link

--- ## Conclusion ---
  • Power up to show a set icon on the micro:bit, after pressing button A, it turns left; after pressing button B, it turns right; after pressing button A+B, it moves forward.

13.5. Exploration


13.6. 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.

13.7. Relevant File