proyectos:talleres:ets:recursos
Diferencias
Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anteriorRevisión previaPróxima revisión | Revisión previa | ||
| proyectos:talleres:ets:recursos [2021/12/01 20:10] – [Github y Código] brolin | proyectos:talleres:ets:recursos [2023/07/19 19:37] (actual) – brolin | ||
|---|---|---|---|
| Línea 1: | Línea 1: | ||
| + | https:// | ||
| + | ====== El taller ====== | ||
| + | |||
| + | {{: | ||
| + | {{: | ||
| + | {{: | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| ====== Videos ====== | ====== Videos ====== | ||
| ===== Sesión 1 ===== | ===== Sesión 1 ===== | ||
| Línea 29: | Línea 40: | ||
| Sensores de calidad del aire y weareables: https:// | Sensores de calidad del aire y weareables: https:// | ||
| + | ===== Fanzine con manual de instalación | ||
| + | |||
| + | {{: | ||
| + | |||
| + | |||
| + | {{ : | ||
| ===== Sesión 3 ===== | ===== Sesión 3 ===== | ||
| Línea 79: | Línea 96: | ||
| https:// | https:// | ||
| + | ==== Ejemplo básico ===== | ||
| <file c++ ejemplo.ino> | <file c++ ejemplo.ino> | ||
| Línea 171: | Línea 189: | ||
| </ | </ | ||
| - | <file c++ matrixlib.ino> | + | FIXME |
| + | ==== Librería para escribir en la matriz ==== | ||
| + | FIXME | ||
| + | |||
| + | <file c++ libmatrix.ino> | ||
| #include < | #include < | ||
| #include < | #include < | ||
| #include < | #include < | ||
| - | #define LED_PIN | + | #define LED_PIN |
| #define LED_TYPE WS2812B | #define LED_TYPE WS2812B | ||
| #define COLOR_ORDER GRB | #define COLOR_ORDER GRB | ||
| Línea 215: | Línea 237: | ||
| #define NUM_LEDS (matrixWidth * matrixHeight) | #define NUM_LEDS (matrixWidth * matrixHeight) | ||
| - | int BRIGHTNESS = 50; | + | int BRIGHTNESS = 10; |
| CRGB leds[matrixWidth * matrixHeight]; | CRGB leds[matrixWidth * matrixHeight]; | ||
| - | int animator = 0; | ||
| const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz) | const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz) | ||
| unsigned int sample; | unsigned int sample; | ||
| - | |||
| - | int inputMin = -2; | ||
| - | int inputMax = 110; | ||
| - | |||
| - | int rangeMin = 20; | ||
| - | |||
| - | int rangeMiddleMin = 21; | ||
| - | int rangeMiddleMax = 60; | ||
| - | |||
| - | int rangleMax = 61; | ||
| - | |||
| - | CRGBPalette16 currentPalette = OceanColors_p; | ||
| - | CRGBPalette16 targetPalette = OceanColors_p; | ||
| - | TBlendType currentBlending = LINEARBLEND; | ||
| class Matrix { | class Matrix { | ||
| Línea 285: | Línea 292: | ||
| for (int j = 0; j < matrixWidth; | for (int j = 0; j < matrixWidth; | ||
| leds[row * matrixHeight + j] = color; // send 1 | leds[row * matrixHeight + j] = color; // send 1 | ||
| + | } | ||
| + | }; | ||
| + | void fill_y_until(CRGB color_shape[][8], | ||
| + | for (int i = 0; i < until; i++) { | ||
| + | for (int j = 0; j < matrixWidth; | ||
| + | leds[i * matrixHeight + j] = color_shape[i][j]; | ||
| + | } | ||
| } | } | ||
| }; | }; | ||
| Línea 291: | Línea 305: | ||
| for (int i = 0; i < matrixHeight; | for (int i = 0; i < matrixHeight; | ||
| leds[i * matrixHeight + column] = color; // send 1 | leds[i * matrixHeight + column] = color; // send 1 | ||
| + | } | ||
| + | }; | ||
| + | void fill_x_until(CRGB color_shape[][8], | ||
| + | for (int i = 0; i < matrixHeight; | ||
| + | for (int j = 0; j < until; j++) { | ||
| + | leds[i * matrixHeight + j] = color_shape[i][j]; | ||
| + | } | ||
| } | } | ||
| }; | }; | ||
| Línea 299: | Línea 320: | ||
| Matrix *mym; | Matrix *mym; | ||
| - | |||
| - | void setup() { | ||
| - | Serial.begin(115200); | ||
| - | LEDS.addLeds< | ||
| - | mym = new Matrix(leds, | ||
| - | FastLED.setBrightness(BRIGHTNESS); | ||
| - | } | ||
| byte sshape[8] = {B00000000, B10101010, B00000000, B10101010, | byte sshape[8] = {B00000000, B10101010, B00000000, B10101010, | ||
| Línea 343: | Línea 357: | ||
| return peakToPeak; | return peakToPeak; | ||
| + | } | ||
| + | |||
| + | void setup() { | ||
| + | Serial.begin(115200); | ||
| + | LEDS.addLeds< | ||
| + | mym = new Matrix(leds, | ||
| + | FastLED.setBrightness(BRIGHTNESS); | ||
| } | } | ||
| void loop() { | void loop() { | ||
| - | | + | int sample = sample_sound(); |
| - | // int maplv = map(sample, inputMin, inputMax, 0, 10); | + | // tomado de https:// |
| + | | ||
| + | Serial.println(logmaplv); | ||
| - | // EVERY_N_SECONDS(5) { | + | for (int i = 0; i <= logmaplv; i++) { |
| - | // for (int i = 0; i < 16; i++) { | + | |
| - | // | + | FastLED.show(); |
| - | | + | FastLED.delay(30); |
| - | // } | + | } |
| - | // mym-> | ||
| - | // FastLED.show(); | ||
| - | // delay(1000); | ||
| - | // mym-> | ||
| - | // FastLED.show(); | ||
| - | // delay(1000); | ||
| - | // mym-> | ||
| - | // FastLED.show(); | ||
| - | // delay(1000); | ||
| - | // mym-> | ||
| - | // FastLED.show(); | ||
| - | // delay(1000); | ||
| - | // mym-> | ||
| - | // FastLED.show(); | ||
| - | // FastLED.delay(1000); | ||
| - | // mym-> | ||
| - | // FastLED.show(); | ||
| - | // FastLED.delay(1000); | ||
| - | // mym-> | ||
| - | // FastLED.show(); | ||
| - | // FastLED.delay(1000); | ||
| - | // mym-> | ||
| - | // mym-> | ||
| - | // FastLED.show(); | ||
| - | // FastLED.delay(1000); | ||
| - | FastLED.clear(); | ||
| - | mym-> | ||
| - | mym-> | ||
| - | FastLED.show(); | ||
| - | FastLED.delay(50); | ||
| - | |||
| - | FastLED.clear(); | ||
| - | mym-> | ||
| - | mym-> | ||
| - | FastLED.show(); | ||
| - | FastLED.delay(50); | ||
| - | |||
| - | FastLED.clear(); | ||
| - | mym-> | ||
| - | mym-> | ||
| - | FastLED.show(); | ||
| - | FastLED.delay(50); | ||
| - | |||
| - | FastLED.clear(); | ||
| - | mym-> | ||
| - | mym-> | ||
| - | FastLED.show(); | ||
| - | FastLED.delay(50); | ||
| - | |||
| - | FastLED.clear(); | ||
| - | mym-> | ||
| - | mym-> | ||
| - | FastLED.show(); | ||
| - | FastLED.delay(50); | ||
| - | |||
| - | FastLED.clear(); | ||
| - | mym-> | ||
| - | mym-> | ||
| - | FastLED.show(); | ||
| - | FastLED.delay(50); | ||
| - | |||
| - | FastLED.clear(); | ||
| - | mym-> | ||
| - | mym-> | ||
| - | FastLED.show(); | ||
| - | FastLED.delay(50); | ||
| - | |||
| - | FastLED.clear(); | ||
| - | mym-> | ||
| - | mym-> | ||
| - | FastLED.show(); | ||
| - | FastLED.delay(50); | ||
| - | FastLED.clear(); | ||
| - | |||
| - | // Serial.println(maplv); | ||
| FastLED.clear(); | FastLED.clear(); | ||
| } | } | ||
| - | </filename> | + | </file> |
| ==== Diagrama electronico ===== | ==== Diagrama electronico ===== | ||
| Línea 443: | Línea 390: | ||
| * https:// | * https:// | ||
| + | * https:// | ||
| + | * | ||
| ====== Contacto ====== | ====== Contacto ====== | ||
proyectos/talleres/ets/recursos.1638389414.txt.gz · Última modificación: por brolin
