Example Code for micro:bit-IR Remote Control

The article offers a comprehensive guide on using micro:bit to control a Maqueen Lite car with an IR remote, including hardware and software setup, wiring instructions, and sample code for commanding car movements like forward, backward, turns, and stops.

Hardware Preparation

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.

Sample Code

Effect: command the car using IR remote controller.

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

Code File: maqueen6.hex

Code Screenshot:

IR Remote Control

Result

Use the key 2, 8, 4, 6, and 5 on the IR remote controller to control Maqueen car to move forward, move backward, turn left, turn right and stop.

Was this article helpful?

TOP