Diferencia entre revisiones de «Tarea 3 LED RGB - Antonia López, Sebastian Perucci, Jose Urrejola»
De Casiopea
Sin resumen de edición |
(→Video) |
||
Línea 77: | Línea 77: | ||
</gallery> | </gallery> | ||
=Video= | =Video= | ||
{{#widget:YouTube|id=qEqFnIqdJcs | {{#widget:YouTube|id=qEqFnIqdJcs}} |
Revisión actual - 17:40 15 jul 2022
Título | Tarea 3 LED RGB - Antonia López, Sebastian Perucci, Jose Urrejola |
---|---|
Asignatura | Interacción y Performatividad |
Del Curso | Interacción y Performatividad 2022 |
Carreras | Diseño, Diseño Gráfico"Diseño Gráfico" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property., Diseño Industrial"Diseño Industrial" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property., 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. |
Nº | 3 |
Alumno(s) | Antonia López, José Urrejola, Sebastian Perucci |
Materiales
- Arduino
- LED RGB
- Botón/Pulsador
- Resistencias (4)
- ProtoBoard
- Cables
Proceso
Código
int estadoLed = 1; int ledRed = 6; int ledBlue = 5; int ledGreen = 3;
void setup () {
pinMode (ledRed, OUTPUT); pinMode (ledBlue, OUTPUT); pinMode (ledGreen, OUTPUT); pinMode (2, INPUT); Serial.begin(9600); }
void loop () {
if (digitalRead(2) == 1) { estadoLed++; if (estadoLed == 4) { estadoLed = 0; } switch(estadoLed) { case 0: digitalWrite(ledRed, LOW); digitalWrite(ledBlue, LOW); digitalWrite(ledGreen, LOW); break; case 1: digitalWrite(ledRed, HIGH); digitalWrite(ledGreen, LOW); digitalWrite(ledBlue, HIGH); break; case 2: digitalWrite(ledRed,LOW); digitalWrite(ledGreen, HIGH); digitalWrite(ledBlue, HIGH); break; case 3: digitalWrite(ledRed, HIGH); digitalWrite(ledGreen, HIGH); digitalWrite(ledBlue, LOW); break; } while (digitalRead(2) == 1) { } } delay(10);
}