Case 05: Automatic Headlights
8. Case 05: Automatic Headlights#
Make your Cutebot turn on its headlights automatically in the darkness.
1 x Cutebot Kit
8.3. Software Platform#
Click the “Advanced” to see more choices in the MakeCode drawer.
A codebase is required for Cutebot programming, click “Add Package” at the bottom of the drawer, search
[Cutebot](https://www.elecfreaks.com/micro-bit-smart-cutebot.html)in the dialogue box and download it.
Note: If you met a tip indicating incompatibility of the codebase, you can continue with the tips or build a new project there.
Set go straight at full speed in
Drag “If…else…” brick into
foreverbrick to judge if the light level is below
10, if yes, set the value of both RGB LEDs as
255, (The combined light is white).
While the value is over
10, set the value of both RGB LEDs as
0to turn off the lights.
You can also download it directly below:
The headlights turn on automatically when going into the darkness and turn off after passing the darkness area.
How to program to make the lights turn on in different colors when going into the darkness in different time? (The value of RGB helps to set the color)