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]