Tarea 3 LED RGB - Catalina González, Daniela Cabezas

De Casiopea



TítuloTarea 3 LED RGB - Catalina González, Daniela Cabezas
AsignaturaInteracción y Performatividad
Del CursoInteracción y Performatividad 2022
CarrerasDiseño, Interacción y Servicios"Interacción y Servicios" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property.
3
Alumno(s)Catalina González, Daniela Cabezas

Registro

Dentro de la tarea 3, se realizo un circuito de LED RGB accionada por un botón, para ello se necesitan los siguiente materiales:

  1. Botón
  2. LED RGB
  3. 4 Resistencias de 1k
  4. Arduino
  5. Protoboard
  6. 10 cables

Paso 1: Configuración de Arduino TINKERCAD

TINKERCAD LED RGB T3.png

Paso 2: Código

int boton = 2; int estado = 0;

void setup() {

 pinMode(11, OUTPUT); //LED rojo
 pinMode(10, OUTPUT); //LED verde
 pinMode(6, OUTPUT); //LED azul
 pinMode(boton, INPUT); //Botón de LED

}

void loop() {

 estado = digitalRead(boton);
 if (estado==HIGH){
   analogWrite (11,249); //LED rojo
   analogWrite (10,0); //LED verde
   analogWrite (6,191); //LED azul
   delay(100); //Tiempo de espera
 }
   
 else{
   analogWrite(11,0);
   analogWrite(10,0);
   analogWrite(6,0);  
 }

}

Imagen LED RGB CATA Y DANI5.jpeg

Paso 3: Registro fotográfico componentes