Example Code for micro:bit-Maqueen V5 Go

Last revision 2025/12/19

This blog post provides example code and detailed instructions for using the micro:bit-Maqueen V5 Go. It includes hardware and software setup, programming steps, and two specific project examples that utilize motor control, RGB lights, and sound integration to enhance the functionality of the robot car.

Hardware Preparation

  • Maqueen V5 Robot Car: 1 (Purchase Link: https://www.dfrobot.com/product-2937.html)
  • micro:bit Mainboard: 1
  • 3 AA Batteries: 1 set

Software Preparation

  • MakeCode Platform: https://makecode.microbit.org/
  • Maqueen Library: Load via MakeCode Extensions (search for "dfrobot" and select "Maqueen")
  • Neopixel Library: Load via MakeCode Extensions (search for "neopixel" and select "neopixel")

Other Preparation Work

  • Ensure the micro:bit mainboard is properly plugged into Maqueen V5.
  • Install the batteries correctly.
  • Turn on the power switch.

Sample Code

Example 1: Maqueen V5 Go!

Program Description:

  • Maqueen moves forward at a speed of 100. Also, it continuously plays music, and the car lights change color at a frequency of one second. The car lights are configured as RGB lights and can display seven colors.
  • The speed range for moving forward is 0 - 255, not 0 - 100. This is also the range of the PWM pulse width.
  • If the speed is within 30, the car may not move. Please set the speed to above 30. The reason is that the motor is driven by PWM. When the speed is low, the driving force will be insufficient. So when the speed is below 30, the driving force is too weak, resulting in the car hardly moving.

Example 2: Swing Car

Program Description:

  • In this example, motor drive, car lights, and bottom RGB lights will be used.
  • The bottom RGB lights will be lit in rainbow colors. The bottom RGB lights of Maqueen V5 are set at the P15 pin. The display range of rainbow colors is from 1 to 360. You can try adjusting the values to observe the color changes.
  • The car will turn right for a while and then turn left for a while. The car lights on the left and right sides will also switch to different colors as well.

Result

  • Example 1: Car moves forward, plays music, and cycles car light colors.
  • Example 2: Car swings left/right, with rainbow ambient lights and changing car light colors.

Was this article helpful?

ON THIS PAGE

TOP