You are on page 1of 20

module 2C:

Mixing light colors

In this module, students will learn:


 How to mix colors
 Using values to mix light colors
 How to program and execute it
Recall: What is a RGB LED?
• RGB LED it is a LED that has 3 color
LED inside it (Red, Green, Blue). It can
produce over 16 million hues of light.

Mio Jr. M2C 2


Recall: How rgb LED works
• The RGB LED works the same as LEDs, but the
unique in RGB LED is you can set the power to the
respective color. If we put 0 power to red and blue
and we put 5V to green then we get green color.

Mio Jr. M2C 3


Recall: What is neopixel
• These are individually LEDs or RGB LEDs all
housed on a string that can be controlled from a
single pin or a single power.

Mio Jr. M2C 4


Recall: What is neopixel

Mio Jr. M2C 5


COLORS
Color is the element of art that is produced when
light, striking an object, is reflected back to the eye.

Mio Jr. M2C 6


COLORS
In programming we change colors by changing the power
applying to it from range 0 to 255. 0 means no power and 255
means full power.

Mio Jr. M2C 7


Recall: How to connect mio jr. to your
pc
• First get your USB to Mini USB cable and plug it to the
Microcontroller (it can reattach to your Mio Jr.).

You should see this in


your PC. MATRIXBIT

Mio Jr. M2C 8


Recall: Makecode
1. Go to makecode.microbit.org
2. Click New project
3. Program and make your codes

Mio Jr. M2C 9


Recall: Makecode
4. Go to Settings and click Extensions.
5. Put in the search tab https://github.com/onion3/Zero
6. Press enter and click the extension showed up.

Mio Jr. M2C 10


Recall: Makecode

Mio Jr. M2C 11


Recall: Makecode
After you click it, it will download into your
workplace and this new menus will be added.

New added menus

Mio Jr. M2C 12


Recall: Makecode
After you code click save then put the download
file into your microcontroller’s folder.

Click this
Find where you
download it then copy
and paste your hex file
to the Matrixbit (G:)

Mio Jr. M2C 13


programming blocks
Programming Function

Set your setup for


Neopixels

Allow you to setup your


Neopixels properties

Allow you to light the


desired color

Mio Jr. M2C 14


programming blocks
Programming Function

Allow you to set custom


values

Pause for milliseconds

Mio Jr. M2C 15


Exercise # 1
Instruction: Guess the color using your Mio
Jr.
Use this blocks

Put this in this slot.

Mio Jr. M2C 16


Exercise # 1

1.
2.
3.
4.
5.

Mio Jr. M2C 17


ACtivity # 1
Instruction: Make a rainbow colors. Show
all the colors of a rainbow starting to red
to violet, and then from violet to red.
This loop will play forever.

Mio Jr. M2C 18


ACtivity # 1
Solution:

Mio Jr. M2C 19


GET EXCITED FOR THE NEXT
ONE!

In this module, students will learn:


 How to make a Christmas car
 How to program and execute it

Mio Jr. M2C 20

You might also like