Example Code for micro:bit-IR-controlled

Last revision 2026/01/14

This guide offers example code and setup instructions for controlling a micro:bit with an infrared remote, using both basic and optimized programs to maneuver the Maqueen Plus V2 robot efficiently.

Hardware Preparation

  • Maqueen Plus V2
  • micro:bit V1/V2
  • Infrared Remote Control

Software Preparation

Wiring Diagram

IR Receiver is built-in.

Other Preparation Work

  1. Complete the Quick Start Guide steps.
  2. Have the infrared remote control ready.

Sample Code

Basic Program Link: https://makecode.microbit.org/_7aThcFKAjDqL

Optimized Program Link: https://makecode.microbit.org/_MsvFPPVWKbqT

Result

Basic: Press 2 (forward), 4 (left), 6 (right), 8 (back).
Optimized: Press 4/6 for short turns, 8 stops the car.

Additional Information

Key values (decimal) for the infrared remote control:

6-5

Was this article helpful?

TOP