Previous site

Magic Lamp

Let’s make a magic lamp that spins and shines.

Build your own magic lamp.

Magic Lamp
Finished model

Blocks needed

  • × 1
  • × 1
  • × 1
  • × 15
  • × 16
  • × 2

How to build 16 steps

  1. Step 1
  2. Step 2
  3. Step 3
  4. Step 4
  5. Step 5
  6. Step 6
  7. Step 7
  8. Step 8
  9. Step 9
  10. Step 10
  11. Step 11
  12. Step 12
  13. Step 13
  14. Step 14
  15. Step 15
  16. Step 16
1 / 16

Coding mission

Code the magic lamp to spin and shine in colors when it gets dark.

Blocks and their jobs

  • DC Motor Block 1Spinning magic wand
  • Light Sensor BlockSensor that detects light
  • Master BlockLamp light

Let's think

Think about machines that work with a light sensor, and talk about what they do.

A smartphone screen that changes its brightness by itself
A streetlight that turns on when it gets dark
Show the solution

When it is bright, the lamp does nothing. When it gets dark, it spins while shining red, yellow, blue and purple lights. The commands inside the condition block keep repeating as long as the condition is detected – check that they really repeat!

Mission complete!

Built it and coded it? Tap to save your progress.