# 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’&#x73;**.**

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

{% hint style="success" %}
Please ensure that you have mBlock setup on you computer. Click [here](https://docs.kidscode.co.za/setting-up-mblock) to setup mBlock
{% endhint %}

You purchased your Arduino kit from the [here](https://www.robofactory.co.za/arduino-kits/66-arduino-uno-r3-basic-starter-kit.html)

{% embed url="<https://www.robofactory.co.za/arduino-kits/66-arduino-uno-r3-basic-starter-kit.html>" %}

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

![](https://1854716099-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/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

Launch the mBlock IDE (<https://ide.mblock.cc/#/>) and select the Arduino Uno Device and install the [Kids Code Extension](https://docs.kidscode.co.za/arduino-kids-lessons/blinking-an-led#install-the-kidscode-extension)&#x20;

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

![](https://1854716099-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/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>" %}
