# LED Switching

## What will we do

In this lesson we will learn how to switch two LED’s on and off one at a time. It will work in the following sequence

* Turn Red LED ON
* Wait for 1 second
* Turn Red LED OFF and Yellow LED ON
* Wait for 1 second

Run the above code for 8 times.

## Parts List

You will need the following parts:

* **1x** arduino uno
* **1x** arduino USB Cable
* **1x** Breadboard
* **3x** Jumper Wire
* **2x** LED (RED and Yellow)
* **2x** Resistor

## **Wiring it up**

![](https://451694785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPda5vaSVRKTQ6AoAmb%2Fuploads%2Fgit-blob-4c09458d4aff6095615d0d650232d0a34f650328%2Fimage.png?alt=media)

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://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://451694785-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPda5vaSVRKTQ6AoAmb%2Fuploads%2Fgit-blob-e6b201398bcf0c6023037547abaa1b89d4685025%2Fimage.png?alt=media)

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.arduinosa.co.za/blocking-coding-lessons/beginner-lessons/led-switching.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
