Example Code for micro:bit-Maqueen Mechanic-Loader
Last revision 2026/01/18
This article provides example code for the micro:bit-Maqueen Mechanic-Loader, including hardware and software preparation, wiring diagrams, and instructions for controlling the loader's servos and movement using an IR remote. It covers how to adjust servo angles, use the MakeCode platform, and provides downloadable code files for practical implementation.
Hardware Preparation
- Maqueen Lite x1
- micro:bit V1/V2 x1
- MicroUSB cable x1
- Maqueen Mechanic-Loader x1 (https://www.dfrobot.com/product-2006.html)
- IR Remote Controller x1 (https://www.dfrobot.com.cn/goods-142.html)
Software Preparation
- Programming Platform: makecode
- Libraries: maqueen, neopixel
Wiring Diagram
- Install the Maqueen Mechanic-Loader as shown in the following figure:

- Plug the servo wires to the port S1 of Maqueen as shown in the figure (brown wire to black pin, red wire to red pin, orange wire to the green pin):

Other Preparation Work
- Load MakeCode Graphical Library for Maqueen as described in the previous example.
- Prepare a Maqueen Mechanic-Loader (https://www.dfrobot.com/product-2006.html) and an IR remote controller (https://www.dfrobot.com.cn/goods-142.html).
Sample Code
Control Servo
Effect: make the shovel to rotate up and down.
Code URL: https://makecode.microbit.org/_1wHJrqgRYHko
Code File: maqueen14-1.hex
Code Screenshot:
IR Remote Control of the Shovel
Effect: use the IR remote controller to control the shovel rotation angle.
Code URL: https://makecode.microbit.org/_CFMhwL03TK5q
Code File: maqueen14-2.hex
Code Screenshot:
IR Remote Control of the Maqueen Mechanic-Loader
Effect: use the IR remote controller to control the Maqueen car to move and the shovel to rotate up and down.
Code URL: https://makecode.microbit.org/_bkvP19V7a6v8
Code File: maqueen14-3.hex
Code Screenshot:

Result
Control Servo
Turn Maqueen on, then the shovel will turn up and down at 90°.
There are two ways to adjust the starting and ending angles of rotation: 1. Adjust the angle value in the code as your need. 2. Remove the two screws on the servo and turn the servo by hand, then reinstall the screws.
IR Remote Control of the Shovel
Use the IR remote controller to make the shovel rotate up and down by directing it at the IR receiver in the front side of Maqueen and pressing the upper and lower triangle keys.
IR Remote Control of the Maqueen Mechanic-Loader
In this example, keys 2, 8, 4, 6, 5 are used to control Maqueen to move forward, move backward, turn left, turn right and stop; press the upper triangle key to control the shovel to turn up, and press the lower for turning down.
Additional Information
The Maqueen Mechanic-Loader and installation effect are as shown in the following figures:

Was this article helpful?
