# LED RGB

Você pode controlar da forma que você quiser, confira o código simples que está na documentação.

Modifique, compartilhe e crie!

## Materiais <a href="#materiais" id="materiais"></a>

* 1 Placa Franzininho;
* 1 Protoboard;
* 1 LED RGB
* 3 Resistor 1k
* 3 Jumpers macho/fêmea;

## Circuito <a href="#circuito" id="circuito"></a>

Na protoboard você pode montar da seguinte forma:

![](/files/-MIfADyVEbf-xYwxgYc5)

## Sketch

```
//RGB com a Franzininho DIY

const int red = 0; 
const int green = 1; 
const int blue = 2; 

void setup() {
  // configura os pinos de cada cor como saída:
  pinMode(red, OUTPUT);
  pinMode(green, OUTPUT);
  pinMode(blue, OUTPUT);
}

void loop() {
  // aciona o LED na cor vermelha:
  digitalWrite(red, HIGH);
  digitalWrite(green, LOW);
  digitalWrite(blue, LOW);
  delay(5000); // aguarda 5000ms 
  
  // aciona o LED na cor verde:
  digitalWrite(red, LOW);
  digitalWrite(green, HIGH);
  digitalWrite(blue, LOW);
  delay(5000); // aguarda 5000ms 

  // aciona o LED na cor azul:
  digitalWrite(red, LOW);
  digitalWrite(green, LOW);
  digitalWrite(blue, HIGH);
  delay(5000); // aguarda 5000ms 
}
```

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


---

# 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://franzininho.gitbook.io/franzininho-docs/exemplos/controle-rgb.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.
