14. Case 13: Remote Control with micro:bit Accelerometer

14.1. Purpose


  • Programme to control the TPBot with the accelerometer.

14.2. Material


../../_images/TPBot_tianpeng_case_01_01.png

14.3. Software


MicroSoftmakecode

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

  • Radio send x which is given by its acceleration dividing 10 in the forever brick.

  • Radio send y which is given by its acceleration dividing 10 in the forever brick.

../../_images/TPBot_tianpeng_case_13_04.png

Link

--- ## Conclusion ---
  • Power up to show the set icon on the micro:bit display, and the movement of TPBot is controlled by the changing angel from the micro:bit.

14.5. Exploration


14.6. FAQ


14.7. Relevant File