Case 10 - Change the Color of LEDs

Part 1   Objective

After you upload the program, the light color of the RGB LEDs on CyberPi changes from red to green, from green to blue, and then from blue to red, and this process repeats over and over again.

12.gif

Part 2   Preparation

  • CyberPi x 1

  • USB cable (Type-C) x 1

  • Computer with network access x 1

Connect CyberPi to the computer by using the cable, open mBlock 5 (PC client or web version), connect CyberPi, and select the Upload mode.

13.gif

14.gif

Part 3   Programming

The light color of the RGB LEDs on CyberPi changes from red to green, from green to blue, and then from blue to red, and this process repeats over and over again at 1-second intervals.

15.gif

Part 4   Practice

  1. Try to change the RGB value and see what happens.

  2. Change the duration to speed up or slow down the color change.

 

 

Was this article helpful?
2 out of 3 found this helpful

Comments

0 comments

Article is closed for comments.