Tarea 2 - Grupo 5 - IyP2023-2
| Título | Tarea 2 - Grupo 5 - IyP2023-2 |
|---|---|
| Asignatura | Interacción y Performatividad |
| Del Curso | Interacción y Performatividad 2023-2 |
| Carreras | Diseño |
| Nº | 2 |
| Alumno(s) | Valentina Blanco, Valentina Dietz, Bruno Vidal Mirauda |
Tarea 2
Elegir un circuito predeterminado de Tinkercad que utilice Arduino y otros componentes. Explicar en qué consiste el circuito.
Componentes
- Tira de luces LED (4)
- Tira de luces LED (8)
- Arduino UNO
Explicación
Se conectan tiras de luces LED a una placa de Arduino UNO para generar un juego lumínico en un constante loop. Se define el PIN 2 como entrada para las tiras LED, se hacen conexiones desde la placa Arduino hacias las tiras para entregar energía de 5v y vinculando el cable GND. Dentro del código se define cantidad de neopixeles y también el pin. Luego se definen los intervalos de colores y la cantidad de tiempo entre uno y otro.
Circuito

Código
#include <Adafruit_NeoPixel.h>
#define PIN 2 // input pin Neopixel is attached to
#define NUMPIXELS 12 // number of neopixels in strip
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int delayval = 100; // timing delay in milliseconds
int redColor = 0;
int greenColor = 0;
int blueColor = 0;
void setup() {
// Initialize the NeoPixel library.
pixels.begin();
}
void loop() {
setColor();
for (int i=0; i < NUMPIXELS; i++) {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(redColor, greenColor, blueColor));
// This sends the updated pixel color to the hardware.
pixels.show();
// Delay for a period of time (in milliseconds).
delay(delayval);
}
}
// setColor()
// picks random values to set for RGB
void setColor(){
redColor = random(0, 255);
greenColor = random(0,255);
blueColor = random(0, 255);
}
Enlace
https://www.tinkercad.com/things/bdVNJAA8n3i-spectacular-esboo