5% OFF Over $19, Code: Elephant5; 10% OFF Over $59, Code: Elephant10



Micro:bit piano board Basic Course 2.4 Control_ brightness_of_RGB

Posted by Fiona Su on

Micro:bit piano board Basic Course 2.4 Control_ brightness_of_RGB

1.Learning goals

In this lesson we mainly learn how to use the music touch return, music button and RGB blocks of Yahboom piano expansion package.

By programming, the brightness of the RGB lamps on the piano board is controlled by touching the seven white keys on the piano expansion board.

2.Programming method

Mode 1 online programming: First, we need to connect the micro:bit to the computer by USB cable. The computer will pop up a USB flash drive and click on the URL in the USB flash drive: http://microbit.org/ to enter the programming interface. Add the Yahboom package https://github.com/lzty634158/YB_Piano to program.

Mode 2 offline programming: We need to open the offline programming software. After the installation is complete, enter the programming interface, click【New Project】, add Yahboom package:

https://github.com/lzty634158/YB_Piano, you can program.

3.Looking for blocks

The following is the location of the building blocks required for this programming.

image.png 

image.png 

image.png 

image.png 

image.png 

image.png 

How to create a new variable:

image.png 

image.png 

4.Combine building block

The summary program is shown below:

image.png 

image.png 

5. Experimental phenomena

After the program is successfully downloaded, a smiley pattern is displayed on the micro:bit dot matrix. When we touch the 7 white keys on the piano expansion board: C key, D key, E key, F key, G key, A key, B key, the brightness of the RGB light on the piano  expansion board will change as shows below.

image.pngimage.png 

image.pngimage.png 

image.pngimage.png 

image.png 

Note: The brightness of the light in the above picture is not obvious. You can download the program to check the specific physical phenomenon.

(If you want to use other keys to control the RGB light to display other colors of different brightness, you can modify the program by yourself)

 The code of the experiment: 4.Control_ brightness_of_RGB.rar

Tutorial

Buy Yahboom Micro:bit Expansion Board Piano Development Board

0 comments

Leave a comment

Please note, comments must be approved before they are published