13. Case 11: micro:bit Remote Control

13.1. Purpose


  • Use another micro:bit as a remote control for your Cutebot.

  • Both micro:bit needs to be programmed.

13.2. Materials


13.3. Software Platform


MicroSoft makecode

13.4. Programming


Step 1

  • Click the “Advanced” to see more choices in the MakeCode drawer.

https://raw.githubusercontent.com/elecfreaks/learn-cn/master/microbitKit/smart_cutebot/images/cutebot-pk-1.png

  • A codebase is required for Cutebot programming, click “Add Package” at the bottom of the drawer, search Cutebot in the dialogue box and download it.

https://raw.githubusercontent.com/elecfreaks/learn-cn/master/microbitKit/smart_cutebot/images/cutebot-pk-11.png

Note: If you met a tip indicating incompatibility of the codebase, you can continue with the tips or build a new project there.

Step 2: Remote Control Programming

  • Set the “radio set group” to 1 in the On start brick.

  • Send radio number in 1 when pressing button A.

  • Send radio number in 2 when pressing button B.

  • Send radio number in 3 when pressing button A+B.

https://raw.githubusercontent.com/elecfreaks/learn-cn/master/microbitKit/smart_cutebot/images/case_11_01.png

Programming

links: https://makecode.microbit.org/_VbpXHCC4jW3T

You can also download it directly below:

Step 3: Cutebot Programming

  • Drag “show icon” brick into the On start brick and set the “radio set group” to 1. Items must be the same with the remote control for the correct match.

  • Drag three “if” bricks into the on radio received brick and judge if the received number is 1, 2 or 3.

  • When the received number is 1, turn left.

  • When the received number is 2, turn right.

  • When the received number is 3, go straight.

https://raw.githubusercontent.com/elecfreaks/learn-cn/master/microbitKit/smart_cutebot/images/case_11_02.png

Programming

Links: https://makecode.microbit.org/_MreDFh8se1LK

You can also download it directly below:

13.5. Result


  • When button A+B being pressed on the remote control, the Cutebot goes straight.

  • When button A being pressed on the remote control, the Cutebot turns left.

  • When button B being pressed on the remote control, the Cutebot turns right.

13.6. Exploration


13.7. FAQ


13.8. Relevant Files