> For the complete documentation index, see [llms.txt](https://monasheng.gitbook.io/zerotohero/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://monasheng.gitbook.io/zerotohero/arduino-zero-to-hero/module-capstone-project/external-led-tasks.md).

# External LED Tasks

The demo board features an `RGB` LED, which works just like 3 small, coloured LEDs, but in a single package. The contacts of this LED are broken out to 4 pins, which are, from left-to-right:

1. the high-side of the `BLUE` LED,
2. the high-side of the `GREEN` LED,
3. the high-side of the `RED` LED, and,
4. a `GND` common to all LEDs.

A single current-limiting resistor is provisioned to support all of the onboard LEDs, and by applying power to only one LED at a time, you can display each primary colour.

<figure><img src="/files/NN6fukBbSQZuDNW1RPUP" alt=""><figcaption></figcaption></figure>

## Task 11 - Verify each LED is functional using Constant Power

* [x] Using jumper wires, connect `GND`, and then each LED on the demo board, one at a time, to constant $$5;\text{V}$$ power via your Arduino.

{% hint style="info" %}
:man\_mage: **Hint:** consult the diagram on the demo board to ensure you have the polarity of your input voltage correct.
{% endhint %}

## Task 12 - Wire each LED for Programmable Control using `digitalWrite()`

* [x] By selecting suitable pins, connect each LED on the demo board to your Arduino for programmable (digital) control.

## Task 13 - Programmatically Control each LED using `digitalWrite()`

* [x] Open a new Arduino Sketch.
  * [x] Write a simple program to:
    * [x] Configure your selected pins for an appropriate output functionality.
    * [x] Illuminate the `BLUE`, `GREEN`, and `RED` LEDs, one-at-a-time, in a loop. Be sure to leave enough time between these that you can visually identify it working!
* [x] Verify and Flash this code using the IDE.
* [x] `File -> Save As...` your sketch for later use.
