LED Chasing

What will we do

In this lesson we will add one more LED and create a light chasing effect. We will use 3 of the same color LED’s.
The sequence for the code will be as follows
  • Turn LED1 ON
  • Wait for 0.5 second
  • Turn LED1 OFF and LED2 ON
  • Wait for 0.5 second
  • Turn LED2 OFF and LED3 ON
  • Wait for 0.5 second
  • Turn LED2 ON and LED3 OFF
  • Wait for 0.5 second
  • Turn LED2 OFF and LED1 ON

Parts List

You will need the following parts:
  • 1x arduino uno
  • 1x arduino USB Cable
  • 1x Breadboard
  • 3x Jumper Wire
  • 3x LED (all same colour)
  • 3x Resistor
Please ensure that you have mBlock setup on you computer. Click here to setup mBlock
You purchased your Arduino kit from the here
Arduino UNO R3 Basic Starter Kit

Wiring it up

Ensure that the LED are the right way around, with the longer positive leads (anodes) to the left.

mBlock IDE

Launch the mBlock IDE (https://ide.mblock.cc/#/) and select the Arduino Uno Device and install the Kids Code Extension

Block Coding

mBlock Block-Based IDE- Coding for Beginners
Last modified 10mo ago