# 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 <a href="#parts-list" id="parts-list"></a>

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

## **Wiring it up** <a href="#wiring-it-up" id="wiring-it-up"></a>

![](https://gblobscdn.gitbook.com/assets%2F-LskXJjPT2bXMIodrtZq%2F-M8uFvpZUQF6EAMa4V3F%2F-M8uHeu1tiNQC2aPMR7m%2Fled%20chasing.png?alt=media\&token=a35967f3-cd03-42e7-b9a2-e17f377c8af4)

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

## mBlock IDE <a href="#mblock-ide" id="mblock-ide"></a>

Launch the mBlock IDE (<https://ide.mblock.cc/#/>) and select the Arduino Uno Device and install the [Kids Code Extension](https://learn.arduinosa.co.za/blocking-coding-lessons/blinking-an-led#install-the-kidscode-extension)

## Block Coding <a href="#block-coding" id="block-coding"></a>

![](https://gblobscdn.gitbook.com/assets%2F-LskXJjPT2bXMIodrtZq%2F-M8uIg8-I0DOXGuIqp1S%2F-M8uIrp0mx1HIy1Qd1Dv%2Fled%20chasing%20-%20code.png?alt=media\&token=3c64d355-5f92-4109-a91c-44d5e5439303)

{% embed url="<https://ide.mblock.cc/#/?cloudProjectId=262546>" %}
