> For the complete documentation index, see [llms.txt](https://learn.breadstick.ca/breadstick/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.breadstick.ca/breadstick/breadsticks/raspberry-breadstick/code-examples/digital-output.md).

# Digital Output

{% tabs %}
{% tab title="1" %}

<figure><img src="/files/Ag45F58IyAhaVm1bostT" alt=""><figcaption><p>A blue LED, a 180 Ohm resistor, and an orange jumper wire.</p></figcaption></figure>
{% endtab %}

{% tab title="2" %}

<figure><img src="/files/D1p6C0nhSzRXPuZw75Xf" alt=""><figcaption><p>It may seem like a simple blue light, but there's an incredible story of innovation and tenacity behind blue LEDs.</p></figcaption></figure>
{% endtab %}

{% tab title="3" %}

<figure><img src="/files/swNmSQee2lPCbnNcZyEI" alt=""><figcaption><p>Orange jumper wire connects the blue bus-rail to GND.</p></figcaption></figure>
{% endtab %}

{% tab title="4" %}

<figure><img src="/files/jUC7KpPzVfue0wrRO07w" alt=""><figcaption><p>Anode (+) of LED connected to D5, Cathode (-) connected to 180 Ohm resistor, resistor connected to GND.</p></figcaption></figure>
{% endtab %}

{% tab title="5" %}

<figure><img src="/files/pcmnydfAhXRQZNFBwgSA" alt=""><figcaption><p>When LED_5.value = True, D5 gets set to 3.3V, forward biasing the light emitting diode.</p></figcaption></figure>
{% endtab %}
{% endtabs %}

## Creation of the blue LED - Won a Nobel Prize!

{% embed url="<https://www.youtube.com/watch?v=AF8d72mA41M>" %}

## Code

```python
"""
Digital Output Demo Code
Breadstick Innovations
April 26, 2024
https://learn.breadstick.ca/breadstick/breadsticks/raspberry-breadstick/code-examples/digital-output
"""

from board import *
from digitalio import DigitalInOut
from time import sleep

led_5 = DigitalInOut(D5)
led_5.switch_to_output()

while True:
    led_5.value = True
    sleep(1)
    led_5.value = False
    sleep(1)
```
