Maqueen Lab // Pinout

Reference · Maqueen Lite v4
🤖 Robot App 🗂️ Catalog 🧪 Labs 🏠 Hub

Maqueen Lite v4 — Pinout Reference

Source of truth for every pin used by Maqueen Lab firmware and the underlying pxt-maqueen extension.

References

About the pxt-maqueen library

pxt-maqueen is DFRobot's official MakeCode extension for the Maqueen family of educational robots (including Maqueen Lite v4). Add it in MakeCode by clicking Extensions → search "maqueen" or pasting its GitHub URL. It exposes a maqueen namespace that wraps the low-level pin and I2C operations behind kid-friendly block APIs:

Maqueen Lab's v1 firmware (firmware/v1-maqueen-lib.ts) uses these maqueen.* calls directly. The future v2 firmware will replace them with raw pins.* and I2C calls — same wire protocol, same web app, lower-level code shown side-by-side in every Component Explorer for educational progression.

Used by Maqueen hardware Conflict with Gravity port Free for user add-ons

micro:bit pin usage

PinUsed byDirectionNotes
P0BuzzerOut (PWM)Default music pin; also Gravity port — conflicts if reassigned
P1Ultrasonic TRIGOutAlso labeled Gravity port — conflicts with ext sensor
P2Ultrasonic ECHOInAlso labeled Gravity port — conflicts with ext sensor
P3freeShared with LED matrix col1 (avoid for digital out)
P4freeLED matrix col2
P5Button AInmicro:bit built-in
P6freeLED matrix col9
P7freeLED matrix col8
P8LED Left (simple)OutDigital ON/OFF
P9freeLED matrix col7
P10freeLED matrix col3
P11Button BInmicro:bit built-in
P12LED Right (simple)OutDigital ON/OFF
P13Line sensor LeftInDigital 0/1
P14Line sensor RightInDigital 0/1
P15free
P16free
P19I2C SCLMotor driver + 4× RGB + servos S1/S2 (addr 0x10)
P20I2C SDASame I2C bus

Component map

ComponentPin / AddressNotes
Motor driverI2C 0x10Reg 0x00 = M1, 0x02 = M2 (direction + speed)
4× RGB ambient lightsI2C 0x10, reg 0x32Not standard NeoPixel — chip-driven via the motor driver IC
LED Left (simple)P8 digitalON/OFF
LED Right (simple)P12 digitalON/OFF
Line sensor LeftP13 digital0 / 1
Line sensor RightP14 digital0 / 1
Ultrasonic TRIGP1SR04 / SR04P
Ultrasonic ECHOP2SR04 / SR04P
BuzzerP0micro:bit default music lib
Servos S1 / S2I2C 0x10 (via extension)Use maqueen.servoRun(S1|S2, angle)
IR receiverP16 (Maqueen Lite v4 default)maqueenIR.initIR(Pins.P16) + per-button onPressEvent(...)

I2C 0x10 register map (motor driver chip)

RegisterFunction
0x00Motor M1 (left): direction + speed
0x02Motor M2 (right): direction + speed
0x14Servo S1 angle
0x15Servo S2 angle
0x324× RGB LED data (16M colors each)

Free for kid add-ons

P3, P4, P6, P7, P9, P10, P15, P16

P3/P4/P6/P7/P9/P10 share the LED display matrix — disable display first if used as digital outputs:

led.enable(false)

Conflict warnings

P0 = buzzer. Plugging anything else into the Gravity P0 port silences the buzzer (or vice versa).

P1 / P2 = ultrasonic. Plugging a Gravity sensor into P1 or P2 disables the ultrasonic. The app will warn when both are used.

I2C bus (P19/P20) is shared. Add-ons at addresses other than 0x10 are fine; address collision is fatal.

How we know — pin assignments traced to source

Every pin assignment below is extracted from the pxt-maqueen extension source. Line numbers refer to maqueen.ts at the time of writing.

Pin / AddressComponentEvidence
P1Ultrasonic TRIGmaqueen.ts:164pins.digitalWritePin(DigitalPin.P1, 1) inside Ultrasonic()
P2Ultrasonic ECHOmaqueen.ts:172d = pins.pulseIn(DigitalPin.P2, PulseValue.High, 500 * 58)
P8LED Left (simple)maqueen.ts:287pins.digitalWritePin(DigitalPin.P8, ledswitch) inside writeLED(LEDLeft, ...)
P12LED Right (simple)maqueen.ts:289pins.digitalWritePin(DigitalPin.P12, ledswitch) inside writeLED(LEDRight, ...)
P13Line sensor Leftmaqueen.ts:267return pins.digitalReadPin(DigitalPin.P13) inside readPatrol(PatrolLeft)
P14Line sensor Rightmaqueen.ts:269return pins.digitalReadPin(DigitalPin.P14) inside readPatrol(PatrolRight)
I2C 0x10Motor + RGB + Servos chipmaqueen.ts:19const MOTER_ADDRESSS = 0x10, used by pins.i2cWriteBuffer(0x10, buf) throughout
I2C 0x10 reg 0x14Servo S1 anglemaqueen.ts:308buf[0] = 0x14 then pins.i2cWriteBuffer(0x10, buf) inside servoRun(S1, angle)
I2C 0x10 reg 0x15Servo S2 anglemaqueen.ts:311buf[0] = 0x15 for S2
I2C 0x10 reg 0x00Motor M1maqueen.ts:202–205buf[0] = 0x00; ...; pins.i2cWriteBuffer(0x10, buf) inside motorRun(M1, ...)
I2C 0x10 reg 0x02Motor M2maqueen.ts:208–211buf[0] = 0x02 for M2
I2C 0x10 reg 0x324× RGB ambient LEDsmaqueen.ts:659pins.i2cWriteNumber(I2CADDR, 0x32, NumberFormat.Int8LE) inside the RGB write block
IR receiver (P16)NEC IRmaqueenIR.cpp defines the API but does not hardcode a pin — user must call maqueenIR.initIR(maqueenIR.Pins.P16). P16 is the convention for Maqueen Lite v4.
P0BuzzerNot in pxt-maqueen. Maqueen Lite v4 wires the on-board buzzer to P0, the micro:bit's default music library output. Confirmed by DFRobot's example sketches on the wiki and matches micro:bit V2's built-in speaker convention.
P19 / P20I2C SCL / SDANot in pxt-maqueen. Standard micro:bit edge-connector I2C pins per tech.microbit.org/hardware/edgeconnector; pins.i2c* calls in pxt-maqueen use these by default.
P5 / P11Button A / BNot in pxt-maqueen. Built into the micro:bit board itself, not the Maqueen carrier.
P3, P4, P6, P7, P9, P10LED matrix columnsNot in pxt-maqueen. Belong to the micro:bit's built-in 5×5 LED display; usable as digital I/O only after led.enable(false).

To re-verify: clone the repo and grep for DigitalPin.P and 0x10:

git clone https://github.com/DFRobot/pxt-maqueen
grep -nE "DigitalPin\.|0x10|0x14|0x15|0x32" pxt-maqueen/maqueen.ts

How Maqueen Lab firmware uses these

Verb (over BLE)micro:bit code
M:L,Rmaqueen.motorRun(M1, dir, |L|) + same for M2
STOPmaqueen.motorStop(All)
LED:i,smaqueen.writeLED(i, s)
SRV:i,amaqueen.servoRun(Si, a)
BUZZ:f,msmusic.playTone(f, ms)
LINE?maqueen.readPatrol(L/R)LINE:l,r
DIST?maqueen.Ultrasonic(cm)DIST:cm
IR?maqueen.IR_read()IR:code
RGB:i,r,g,bI2C write to 0x10 reg 0x32
(auto)input.acceleration(X/Y/Z)ACC:x,y,z

See firmware/v1-maqueen-lib.ts for the full implementation.

Future: raw-pin firmware (v2)

Phase 2 firmware (firmware/v2-raw-pins.ts) will replace maqueen.* calls with direct pins.* and pins.i2cWriteBuffer(...) operations — same wire protocol, lower-level code for advanced learners. The Component Explorers will show both versions side-by-side in the code panel.

← Back to Robot App