Skip to main content

Case 05 Rainbow Lights

Introduction

This course aims to let students learn and explore knowledge points such as car motor control and RGB light control by making smart racing cars and applying this knowledge to realize the rainbow-like light of the car during driving.

Teaching Objectives

Understand the principle and control method of RGB lights, and learn to control the color and brightness of lights.

Learn to apply motor control and RGB light control to Cutebot Pro smart racing car to achieve rainbow light effect.

Teaching Preparation

Cutebot Pro × 1

micro:bit × 1

Teaching process

Course Introduction

Hello everyone! Today we're continuing our smart car making project, but this time we're going to add some fancy special effects to the car. Have you ever wondered how to make the car glow like a rainbow while driving?

In the next lesson, we will learn how to control the RGB lights and realize a car that emits rainbow-like lights while driving.

Inquiry activities

How to use the motor control and RGB lights of the car to realize a car that can emit rainbow-like light during driving?

How can we control the brightness and color of rainbow lights?

Sample Code

Link:https://makecode.microbit.org/_MqxCqxJquPAs

You can also download the program directly from the following web page:

Teamwork and Presentation

Students are divided into groups to complete the production and programming of the car together.

Students are encouraged to collaborate, communicate and share experiences with each other.

Each team had the opportunity to present their smart car to the other teams and demonstrate the effect of the rainbow lights on the road.

Summary and Reflection

Review course content to remind students of what knowledge and skills they have acquired.

Guide students to discuss the problems and difficulties they encountered in the production process, and how to solve these problems.

Guide students to think about the optimization and improvement of rainbow car lights, such as adjusting the order of light switching, adding other special effects, etc.

Outreach Activities

Challenge students to improve the rainbow car light effect, such as adding special effects such as flashes and gradients.

Guide students to design and realize other interesting lighting effects, such as changing with the rhythm of music, adjusting brightness according to the intensity of ambient light, etc.

Encourage students to use their creativity and imagination to design their own unique car lighting effects.