# 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)
```


---

# 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.breadstick.ca/breadstick/breadsticks/raspberry-breadstick/code-examples/digital-output.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.
