Basic Courses for Cars

1. Motor Control

Effects: It can control the car to move forward, backward, turn left, turn right, rotate left and right, stop, etc., and the speed of the car can be set.

Effect demonstration:

../_images/%E7%94%B5%E6%9C%BA%E6%8E%A7%E5%88%B6G.gif

makecode program link: https://makecode.microbit.org/S95796-94350-74983-15795

Screenshot of makecode graphical interface:

../_images/%E7%94%B5%E6%9C%BA%E6%8E%A7%E5%88%B6C.png

2. Music Car

Effect: The car can play pre-set music.

makecode program link: https://makecode.microbit.org/S93528-06251-15177-28056

Screenshot of makecode graphical interface:

../_images/%E9%9F%B3%E4%B9%90%E5%B0%8F%E8%BD%A6C.png

1. Seven-Color Searchlight

Effect: The car is equipped with two colorful spotlights on the left and right sides, and the color and flashing pattern of the lights can be controlled by programming.

Effect demonstration:

../_images/%E4%B8%83%E5%BD%A9%E6%8E%A2%E7%85%A7%E7%81%AFG.gif

makecode program link: https://makecode.microbit.org/S48161-29282-53225-53062

Screenshot of makecode graphical interface:

../_images/%E4%B8%83%E5%BD%A9%E6%8E%A2%E7%85%A7%E7%81%AFC.png

4. RGB Running Light

Effect: Four WS2812 lights are installed at the bottom of the car. The color and flashing mode of the lights can be controlled by programming to realize the sequential color change of the marquee.

Effect demonstration:

../_images/RGB%E8%B7%91%E9%A9%AC%E7%81%AFG.gif

makecode program link: https://makecode.microbit.org/S23470-56019-18472-86312

Screenshot of makecode graphical interface:

../_images/RGB%E8%B7%91%E9%A9%AC%E7%81%AFC1.png
../_images/RGB%E8%B7%91%E9%A9%AC%E7%81%AFC2.png
../_images/RGB%E8%B7%91%E9%A9%AC%E7%81%AFC3.png

5. RGB Breathing Light

Effect: Four WS2812 lights are installed at the bottom of the car. The color and flashing mode of the lights can be controlled by programming to achieve a breathing light effect.

Effect demonstration:

../_images/RGB%E5%91%BC%E5%90%B8%E7%81%AFG.gif

makecode program link: https://makecode.microbit.org/S42098-98692-58148-98413

Screenshot of makecode graphical interface:

../_images/RGB%E5%91%BC%E5%90%B8%E7%81%AFC.png

6. Light Tracking

Effect: MicroBit comes with an ambient light sensor, which can be programmed to control the car to adjust its speed according to the intensity of light, thus achieving a light-chasing effect.

Effect demonstration:

../_images/%E8%BF%BD%E5%85%89G.gif

makecode program link: https://makecode.microbit.org/S14523-36545-26778-18250

Screenshot of makecode graphical interface:

../_images/%E8%BF%BD%E5%85%89C.png

7. Line Tracking

Effect: Two infrared sensors are installed on the bottom of the car. The car can be programmed to adjust its direction of travel according to the black lines on the ground, thus achieving the effect of tracking.

Effect demonstration:

../_images/%E5%B7%A1%E7%BA%BFG.gif

makecode program link: https://makecode.microbit.org/S82467-65410-61513-88116

Screenshot of makecode graphical interface:

../_images/%E5%B7%A1%E7%BA%BFC.png

8. Ultrasonic Ranging

Effect: An optional ultrasonic sensor is installed at the front of the car, which can be programmed to measure the distance to obstacles in front and display the result on MicroBit’s LED screen.

Tip

Before using the ultrasonic function, you should switch to ultrasonic mode.

../_images/%E5%AE%89%E8%A3%85%E8%B6%85%E5%A3%B0%E6%B3%A2.jpg

Effect demonstration:

../_images/%E8%B6%85%E5%A3%B0%E6%B3%A2%E6%B5%8B%E8%B7%9DG.gif

makecode program link: https://makecode.microbit.org/S98856-20868-77452-43719

Screenshot of makecode graphical interface:

../_images/%E8%B6%85%E5%A3%B0%E6%B3%A2%E6%B5%8B%E8%B7%9DC.png

9. Ultrasonic Obstacle Avoidance

Effect: An ultrasonic sensor can be optionally installed at the front of the car. The car can be programmed to measure the distance to obstacles in front and adjust its direction of travel according to the distance to achieve obstacle avoidance.

Effect demonstration:

../_images/%E8%B6%85%E5%A3%B0%E6%B3%A2%E9%81%BF%E9%9A%9CG.gif

makecode program link: https://makecode.microbit.org/S20248-94240-76314-39688

Screenshot of makecode graphical interface:

../_images/%E8%B6%85%E5%A3%B0%E6%B3%A2%E9%81%BF%E9%9A%9CC.png

10. Ultrasonic Following

Effect: An ultrasonic sensor can be optionally installed at the front of the car. It can be programmed to measure the distance to obstacles in front of it and adjust the driving speed according to the distance to achieve a following effect.

Effect demonstration:

../_images/%E8%B6%85%E5%A3%B0%E6%B3%A2%E8%B7%9F%E9%9A%8FG.gif

makecode program link: https://makecode.microbit.org/S30884-31518-90039-02970

Screenshot of makecode graphical interface:

../_images/%E8%B6%85%E5%A3%B0%E6%B3%A2%E8%B7%9F%E9%9A%8FC.png

11. Servo Drive

Effect: The car has a servo interface. By connecting a servo, the rotation angle of the servo can be controlled through programming to achieve some special actions.

Effect demonstration:

../_images/%E8%88%B5%E6%9C%BA%E9%A9%B1%E5%8A%A8G.gif

makecode program link: https://makecode.microbit.org/S43067-53664-12051-64290

Screenshot of makecode graphical interface:

../_images/%E8%88%B5%E6%9C%BA%E9%A9%B1%E5%8A%A8C.png

Tip

Due to limitations in installation space, weight, and power supply for the basic/ultrasonic/forklift form factors, adjustments may be necessary. Alternatively, you can combine them with other sensors and modules to achieve richer demonstration effects. Now, unleash your creativity and create your own cool effects.