The four LED modules, i.e. the headlights of the Joy-Car, can be controlled in this category. So you can control the front headlights, activate turn signals and brake lights and find even more functions here.
Headlights
![](/files/files/Anleitungen/MakeCode/Tutorials/10_joycar-lights/en/lights-en-1.png)
With this you control the headlights. A white light is activated at the front and a red light at the back.
Turn signal
![](/files/files/Anleitungen/MakeCode/Tutorials/10_joycar-lights/en/lights-en-3.png)
Check the turn signal for one side (left/right) of the joy car. The front and rear headlights on the selected side start flashing yellow.
Hazard lights
![](/files/files/Anleitungen/MakeCode/Tutorials/10_joycar-lights/en/lights-en-4.png)
This controls the warning light. All lights will start flashing yellow.
Brake light
![](/files/files/Anleitungen/MakeCode/Tutorials/10_joycar-lights/en/lights-en-2.png)
This controls a brighter, red light on the rear headlights of your Joy-Car.
Reverse light
![](/files/files/Anleitungen/MakeCode/Tutorials/10_joycar-lights/en/lights-en-5.png)
Use this to check the reversing light. This makes a white light shine on the rear headlights.
Lighting - Example 1
In the following example, the light functions are run through one after the other. The function of the code is identical to the code from motors - example 1. In this code, the variable counter is used to define the duration of each mode. (mode: 0 = light on; 1 = left turn blinker; 2 = stop light; 3 = hazard lights; 4 = reverse light)
![](/files/files/Anleitungen/MakeCode/Tutorials/10_joycar-lights/en/09-2_lights.png)