In daily traffic, vehicles use turn signals to communicate their intentions to pedestrians and other vehicles, which is essential for traffic safety. In this lesson, we’ll program the Maqueen Lite V5 robot to simulate this function: combining the front RGB headlights and buzzer module to activate the corresponding light and sound alerts during left turns, right turns, and reversing.
Through this lesson, students will further master the programming methods for coordinating device states with peripheral responses, and understand the value of signal feedback in automated systems.

Task Objective
This lesson aims to guide learners in programming the Maqueen Lite V5 to control the RGB headlights and buzzer module, enabling the robot to provide synchronized light and sound feedback in different motion states. The specific functions include:
- Left turn: Left headlight turns red, buzzer plays a sound.
- Right turn: Right headlight turns red, buzzer plays a sound.
- Reversing: Both headlights turn white for 2 seconds, then stop.

Knowledge Points
1.Understand the basic principles of differential steering.
2.Learn to control RGB headlight colors and power states.
3.Familiarize with buzzer melody playback and button-triggered events.
4.Achieve multi-state synchronization of lights and sounds.
Materials List
Software
Mind+ Programming Software x1
Download link: https://mindplus.cc/

Practical Exercise
To realize the intelligent turn signal function of the car, you must first master how to control the Maqueen Lite V5's RGB front headlights, enabling the lights to turn on according to the settings.
Next, add a sound alert so that the car can simultaneously light up the corresponding side's signal light and play a warning sound when turning, simulating real vehicle turn signals and further enhancing the car’s intelligent behavior.
Task 1: Light Up the RGB Headlights
Learn the basic lighting control method and implement a red flashing effect on the front headlights.
Task 2: Multi-State Light and Sound Linkage
Based on Task 1, combine the micro:bit's button and logo touch functions to light up the corresponding side's signal light and play a warning sound under different operations.
Task 1: Light Up the RGB Headlights
Next, let's light up the RGB light together with the following program, making the car’s front light flash red.
1.Programming
In the "Forever" loop, set all RGB headlights to red and keep them on for 1 second. Then turn off the lights and pause for another second. By repeating this process, the robot’s headlights will flash red.

2.Program Execution
After downloading, the robot’s front lights will flash red every 1 second (on for 1s → off for 1s).

Task 2: Multi-State Light and Sound Linkage
Building upon Task 1, we’ll now use the micro:bit’s buttons and touch-sensitive logo to trigger different states — turning left, right, and reversing — by lighting the corresponding headlight and playing a sound.
1.Understanding micro:bit Buttons and Logo
micro:bit offers multiple interactive methods:
- Buttons A / B: Located on the left and right sides of the micro:bit, used to trigger specific events.
- Logo area: Touch-sensitive; a light touch will trigger preset actions.

2. Programming
(1)Left Turn State
Start by initializing the robot. In the "When Button A Pressed" block: set all motors to move forward at speed 45. Then continue forward on the right motor and reverse the left motor at speed 35 to perform a left turn. Light the left RGB headlight in yellow to indicate the turn signal.

Then play a tone using the buzzer to indicate the left turn. After 1 second, stop all motors and turn off the left headlight to complete the turn.

(2)Right Turn State
To perform a right turn, follow a similar process. In the "When Button B Pressed" block: move forward at speed 45 for 1 second, then keep the left motor at speed 45 and reverse the right motor at speed 35. Light the right RGB headlight in yellow and play a buzzer sound. After 1 second, stop all motors and turn off the right headlight.

(3)Reverse State
In the "When microbit pin LOGO(V2) connected" block: set all motors to reverse at speed 50 to start reversing. Light both RGB headlights in white as a visual cue. After 2 seconds, stop all motors and turn off the headlights to finish the reverse.

3.Program Execution
Before running, locate the buzzer switch on the bottom of the robot and turn it on.

After startup and initialization, use the micro:bit buttons and logo to control various states.
Press Button A: Robot turns left, left headlight turns yellow, buzzer plays a tone, then everything stops after 1 second.
Press Button B: Robot turns right, right headlight turns yellow, buzzer plays a tone, then everything stops after 1 second.
Touch the logo: Both headlights turn white, robot reverses for 2 seconds, then motors and lights stop automatically.

Knowledge Corner
1.Understanding Differential Steering
Imagine you’re playing with a remote-controlled car. When you want it to turn, how does it do that? A robot with differential steering uses this principle:
The robot has one motor on each side, driving its wheels. When both motors spin at the same speed, the robot moves straight — just like when we walk using both legs in sync.
When turning — say, to the left — the left motor slows down or even reverses, while the right motor keeps going or speeds up. This causes the robot to pivot or arc left.
It’s similar to how we turn while walking — our left leg might take a smaller step or stop, while the right leg continues. This control of different motor speeds is called differential steering.
- Straight: All motors move forward at the same speed.
- Reverse: All motors move backward at the same speed.
- Left Turn: Right motor speeds up, left motor slows down or reverses.
- Right Turn: Left motor speeds up, right motor slows down or reverses.
2.Learning the Commands

Challenge Yourself
After completing this lesson, students have learned the basics of light and sound control. Now, try using the following two blocks to make the robot flash different colors while moving. This will further improve your understanding and creativity in synchronizing light with movement.
Next lesson: Lesson 4 RGB Ambient Light Show








![[Boson for micro:bit] Mind+ and micro: bit 01](https://dfimg.dfrobot.com/5dbaa190f2c4183e48c5a2b7/makelog/03f9dae68bc594a9f63386774fe54ee7_224x164.jpg)
