The Direction Lights of the Cutebot
Introduction
We may program to make the Cutebot turn on its directional lights while it turns. It’s also possible to control the lights via Joystick:bits or sensors, here I’ve programmed to change its driving status at random for each scheduled time.
Materials required
The Cutebot(https://www.elecfreaks.com/micro-bit-smart-cutebot.html)
Programme
We need to initialize the clearance lamps at first. Drag show icon to on start brick, initialize the strip connected to P15 by assigning 2 pieces LEDs, set the headlights light on in white.
If we want the car to drive randomly, we need to set two variables with random values from 0 to 100, and then use the values of the two variables as the speed of the left and right wheels.
Judge the speed of both wheels. When the speed of the left wheel is bigger than the speed of the right, turn on the light on the right; when the left wheel speed is less than the right wheel, turn on the light on the left, and then delay 2000ms.
Program:
Link:https://makecode.microbit.org/_FHx2ov36vCYx
Result
After powering on, the LED screen of the micro:bit displays a preset icon, the headlights light up in white, the Cutebot randomly changes its driving direction every two seconds, and lights up the corresponding turn indicator lights.
Share this post
About the Author
ELECFREAKS focuses on microbit and publishes interesting articles
Topics
- Curriculum
- Course
- Micro bit supplier
- Wholesale Suppliers
- Micro bit tutorial
- Micro bit classroom pack
- Mcorbit Environment Monitoring
- Temperature-controlled
- Motor
- Fan
- TPBot car
- TPBot
- Micro:bit car
- AI Lens
- Micor:bit AI Lens
- Micro:bit LEDs
- BBC micro:bit
- Micro:bit Manipulator
- Wukong board
- Cutebot
- Micro:bit Motorcycle
- Nezha breakout
- Micro:bit DIY
- 360° servos
- AI Lens
- Retro Arcade
- Ecode
- PlanetX
- Microbit programming
- Your:bit
- Do your:bit
- IoT:bit
- Octopus
- Rainbow LED Ring
- Joystick:bit
- Wonder Building Kit
- Sensor:bit
- Downie
- Wenjie
- Laser Engraver Tutorial
Tags
Comments