Example Code for micro:bit-Read IR Key Assignments

Last revision 2026/01/14

This guide offers a comprehensive approach to using micro:bit and Maqueen Lite for reading IR key assignments, featuring hardware/software setup, sample code, and visual results on the LED matrix.

Hardware Preparation

  • Maqueen Lite x1
  • micro:bit V1/V2 x1
  • MicroUSB cable x1
  • IR Remote Controller x1 (https://www.dfrobot.com.cn/goods-142.html)

Software Preparation

  • Programming Platform: makecode
  • Libraries: maqueen, neopixel

Wiring Diagram

No additional wiring is required except inserting the micro:bit into Maqueen Lite.

Other Preparation Work

  1. Load MakeCode Graphical Library for Maqueen as described in the previous example.
  2. Prepare an IR remote controller (https://www.dfrobot.com.cn/goods-142.html).

Sample Code

Effect: when the robot car receives IR data, they are converted to IR key assignments and display on the micro:bit LED matrix.

Code URL: https://makecode.microbit.org/_Uu14FC529YoM

Code File: maqueen5.hex

Code Screenshot:

Result

Press the key on the IR remote controller and the the micro:bit LED matrix will display the corresponding IR key assignments.

Additional Information

The IR remote controller used in this example and its assignments are as shown in the following figure.

IR Remote Controller: https://www.dfrobot.com.cn/goods-142.html

Was this article helpful?

TOP