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



Microbit Halo Programmable Expansion Board Tutorial 1.4 Breathing light

Posted by Fiona Su on

Microbit Halo Programmable Expansion Board Tutorial 1.4 Breathing light (download)

1.Principle:

The data protocol of the programmable RGB lamp adopts the single-line return-to-zero code communication mode. After the power-on reset, the DIN terminal accepts the data transmitted from the controller. The first 24 bits of data sent by the first pixel are extracted, the data latch is sent to the inside of the pixel. And the remaining data is shaped and amplified by the internal shaping processing circuit, then the output is forwarded to the next cascaded pixel by the DO port.

image.png 

Note:

If the programmable RGB lamp is fully lit, the battery is not enough voltage, it will affect the effect,such as color saturation of RGB lamp is reduced or microphone not work normally.

 It is recommended to use the USB data cable to plug in the RGB LED Circular  expansion board interface. As shown in the figure below.

image.png 

2. Learning goals:

In this lesson we will learn how to realize that brightness of lights on the RGB LED Circular from large to small,small to large. And the light will change different color. 

3. Programming method:

Online programming:

First,we need to connect the micro:bit to the computer by USB data cable, the computer will pop up a USB flash drive.Then, click on the URL in the USB flash drive: http://microbit.org/ to enter the edit process interface.

Offilne programming:

Open the offline programming softwareimage.png,download address of this software: http://www.microbitgo.com/code.

After creating a new project, you need to load the Neopixel library to program the programmable RGB lights. To load the library, click on 【Advanced】—【Extensions】 — click on 【Neopixel】, and you will see an extra column in the programming interface. As shown in the figure below.

image.png 

image.png 

image.png 

General program diagram:

image.png 

In this experiment we used an array. We put 7 colors into the array list, click “+” to add the contents of the array, and click“-” to indicate the deletion.

image.png 

image.png 

Click on the place shown below to select the color of the RGB lights.

image.png 

Then, the contents of the array List are taken out one by one. And the effect of the breathing state is executed in the form of the variable color 2.

image.png 

We need to use the statement shown below. The meaning of this statement is that the variable d is executed from 0 to 4, that is, the code inside is executed 4 times.

image.png 

As shown in the following figure, it means that the brightness of the RGB lamp is increased from 0 to 100, which realizes the effect of slowly lighting.

image.png 

As shown in the following figure, it means that the brightness of the RGB lamp is reduced from 100 to 00, which realizes the effect of slowly  extinguishing.

image.png

4. Download program

We need to make sure that the micro:bit board is connected to the computer. Click the download in the lower left corner as shown below, and select the download path as micro:bit drive letter to download the program.

image.png

5. experimental phenomena

after the program is successfully downloaded, you can see that brightness of lights on the RGB LED Circular from large to small, small to large. and the light will change different color.                            

image.pngimage.png

image.pngimage.png

Tutorial

Microbit Halo Programmable Expansion Board Tutorial

Buy Yahboom Microbit Halo Programmable Expansion Board

0 comments

Leave a comment

Please note, comments must be approved before they are published