> For the complete documentation index, see [llms.txt](https://learn.arduinosa.co.za/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.arduinosa.co.za/blocking-coding-lessons/beginner-lessons/led-switching.md).

# 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**

![](/files/-MRkPtNOZI6lfYZUA952)

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](/blocking-coding-lessons/beginner-lessons/blinking-an-led.md#install-the-kidscode-extension) \*\*\*\*

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

![](/files/-MRkQ-CA4yacwvZxzzId)

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
