Lesson 3 Home Lighting: Staircase Light Programming
Challenges: 3-1, 3-2
Students program UNIHIKER K10 to show different light modes.
I can turn on and off LEDs in different ranges.
I can make a rainbow strip light and change its brightness.
I understand the difference between on start and forever and use them correctly.
Engage
2 min.
Start a brief class discussion. Ask students to think about their own homes. What happens when they turn on a stair light? Is it too bright? Not bright enough? Does it light up all steps? This real-world problem sets the stage for today's programming challenge.

How can we provide safe and comfortable lighting when going up and down the stairs at night?
Background
3 min.
The LED strip is made of 7 individual LEDs (Light Emitting Diodes) that we can control with code.
We can tell each LED what color to be and how bright to shine, all from our program.

NOTE: the LED strip’s block is in its library, which need to be import from Extension’s page.

The show color block is how we tell the program to use the LED strip. It can show different colors in different range of the LED strip.

Build and Connect
10 min.
![]() | Build together by the building instruction. |
Students should set up the stair LED strip and connect it to the UNIHIKER K10 using the correct pins.
Program
25 min.
Challenge 3-1: Exploring Basic LED Control
![]() | Ask students to make hardware connections. Have students prepared for programming. |
![]() | Guide students to rebuild the program to turn on the entire LEDs on the LED strip. |
![]() | ![]() Encourage students to control different numbers of LEDs. Can you light just the first three? Or every other one?There's no single right answer here. The goal is for students to discover how to target specific LEDs in the strip. Here is a sample: |
![]() | ![]() Challenge students to use the show gradient color block to create a rainbow effect. Prompt them to modify the last two parameters. Try setting from 0 to 120, what color do you get? What about 240?Introduce the color wheel to reveal the relationship between colors and parameters. The parameters correspond to Hue (H) values: 0/360 = red, 120 = green, 240 = blue. |
![]() | ![]() Encourage students find a level that would be perfect for a night light - not too dim, not too glaring. Here’s what the completed program3-1 should look like. |
Challenge 3-2: Create a Flowing Light
![]() | ![]() Students have to add more blocks to the program so that LEDs rotate forward. Here’s what the completed program should look like. |
![]() | Increasing the time in the wait blocks will make the lights rotate forward more slowly. Prompt students to find a speed that they like best. |
![]() | Drag the rotate sequence into the forever block. The loop will then run continuously. You can find the completed program3-2 in the attachment. |
Extra Practice
5 min.
Go back to your rainbow effect code.
Drag the pick random block from the operators category into the last parameter of show gradient color block. What happens?

Next Class: Lesson 4
Current Tutorial: Click Here






















