0% found this document useful (0 votes)
26 views1 page

RGB LED Control with Smart Robot

This document provides instructions for an RGB LED experiment using a micro:bit-powered robot. The goal is to learn how to control and set the RGB LED color on the robot. The steps include opening the MakeCode editor, adding a code extension for the robot, using code blocks to set the LED brightness to 70% and cycle through different RGB color combinations with 100ms pauses between each setting. An example simulation and purchase link for the robot are also provided.

Uploaded by

jjorge.duque
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views1 page

RGB LED Control with Smart Robot

This document provides instructions for an RGB LED experiment using a micro:bit-powered robot. The goal is to learn how to control and set the RGB LED color on the robot. The steps include opening the MakeCode editor, adding a code extension for the robot, using code blocks to set the LED brightness to 70% and cycle through different RGB color combinations with 100ms pauses between each setting. An example simulation and purchase link for the robot are also provided.

Uploaded by

jjorge.duque
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Scan QR code for Lesson 2.

1 Simulation
Lesson 2.1 - RGB LED Experiment
Simulation of this lesson can be found at [Link]
Note: (Robot construction must be completed before this Step)

Goal for this lesson


Learn to control set and hold the RGB LED on the Smart Robot with variable manipulation.

Hardware Required
PC or Tablet
1 x micro USB cable
1 x Smart Robot with micro:bit & battery installed

Step 1 As per Figure 1. Figure 1


a. Goto URL [Link]
b. Create “+New Project” & give it a name
c. Press Gear symbol – top right
d. Press Extensions
e. Add repository found using link below.
[Link]
f. On start up both “on start” & “forever” will be in your
work space, move “forever” block below “on start” block.

Step 2 As per Figure 2.


a. Press “K_Bit” Tab
b. Drag “LED brightness 0” into the “on start” field,
adjust variable to brightness of “70”
c. Drag “set RGBled R: 0 G: 0 B: 0” in to “forever” field.
Adjust variables in the R, G, B field for each.
RGB – represent Red, Green, Blue.
0-255 – represent 0-100% of each colour. Figure 2

Step 3 As per Figure 3


a. Press “Basic” Tab
b. Drag “pause (ms) 100” into “forever” field below each
LED set figure, adjust pause variable as desired.
c. Repeat Step 3 for each LED set figure.
d. Download the code to the micro:bit

Figure 3

Example RGB LED Experiment 2.1 can be found at


[Link]

STEM Smart Robot can be purchase from Altronics.


[Link]

You might also like