Herramientas de usuario

Herramientas del sitio


proyectos:talleres:ets:recursos

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anteriorRevisión previa
Próxima revisión
Revisión previa
proyectos:talleres:ets:recursos [2021/12/01 20:10] – [Github y Código] brolinproyectos:talleres:ets:recursos [2023/07/19 19:37] (actual) brolin
Línea 1: Línea 1:
 +https://wiki.unloquer.org/_media/proyectos/talleres/ets/talleretsbibliosanjavier.mp4
 +====== El taller ======
 +
 +{{:proyectos:talleres:ets:whatsapp_image_2021-12-10_at_17.28.06.jpeg?200|}}
 +{{:proyectos:talleres:ets:whatsapp_image_2021-12-10_at_17.28.56.jpeg?200|}}
 +{{:proyectos:talleres:ets:whatsapp_image_2021-12-10_at_17.30.28.jpeg?400|}}
 +
 +
 +
 +
 +
 ====== Videos ====== ====== Videos ======
 ===== Sesión 1 ===== ===== Sesión 1 =====
Línea 29: Línea 40:
 Sensores de calidad del aire y weareables: https://youtu.be/8ZFxrDkVOFk  Sensores de calidad del aire y weareables: https://youtu.be/8ZFxrDkVOFk 
  
 +===== Fanzine con manual de instalación  =====
 +
 +{{:proyectos:talleres:ets:sin_titulo.png?nolink&200|}}
 +
 +
 +{{ :proyectos:talleres:ets:sin_titulo.pdf |}}
 ===== Sesión 3 ===== ===== Sesión 3 =====
  
Línea 79: Línea 96:
 https://github.com/unloquer/ETSesnor https://github.com/unloquer/ETSesnor
  
 +==== Ejemplo básico =====
 <file c++ ejemplo.ino> <file c++ ejemplo.ino>
  
Línea 171: Línea 189:
 </file> </file>
  
-<file c++ matrixlib.ino>+FIXME 
 +==== Librería para escribir en la matriz ==== 
 +FIXME 
 + 
 +<file c++ libmatrix.ino>
 #include <Arduino.h> #include <Arduino.h>
 #include <FastLED.h> #include <FastLED.h>
 #include <algorithm> #include <algorithm>
-#define LED_PIN D1+#define LED_PIN D3
 #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; // NOBLEND or LINEARBLEND 
  
 class Matrix { class Matrix {
Línea 285: Línea 292:
     for (int j = 0; j < matrixWidth; j++) {     for (int j = 0; j < matrixWidth; j++) {
       leds[row * matrixHeight + j] = color; // send 1       leds[row * matrixHeight + j] = color; // send 1
 +    }
 +  };
 +  void fill_y_until(CRGB color_shape[][8], int until) {
 +    for (int i = 0; i < until; i++) {
 +      for (int j = 0; j < matrixWidth; j++) {
 +        leds[i * matrixHeight + j] = color_shape[i][j]; // send 1
 +      }
     }     }
   };   };
Línea 291: Línea 305:
     for (int i = 0; i < matrixHeight; i++) {     for (int i = 0; i < matrixHeight; i++) {
       leds[i * matrixHeight + column] = color; // send 1       leds[i * matrixHeight + column] = color; // send 1
 +    }
 +  };
 +  void fill_x_until(CRGB color_shape[][8], int until) {
 +    for (int i = 0; i < matrixHeight; i++) {
 +      for (int j = 0; j < until; j++) {
 +        leds[i * matrixHeight + j] = color_shape[i][j]; // send 1
 +      }
     }     }
   };   };
Línea 299: Línea 320:
  
 Matrix *mym; Matrix *mym;
- 
-void setup() { 
-  Serial.begin(115200); 
-  LEDS.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS); 
-  mym = new Matrix(leds, 64); 
-  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<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS);
 +  mym = new Matrix(leds, 64);
 +  FastLED.setBrightness(BRIGHTNESS);
 } }
  
 void loop() { void loop() {
-  // int sample = sample_sound(); +  int sample = sample_sound(); 
-  // int maplv map(sample, inputMin, inputMax, 0, 10);+  // tomado de https://forum.arduino.cc/t/map-but-log/379910/
 +  int logmaplv log(sample + 1) / log(900) * 9; 
 +  Serial.println(logmaplv);
  
-  // EVERY_N_SECONDS(5) { +  for (int i = 0; i <= logmaplv; i++) { 
-  //   for (int i = 0; i < 16; i++) { +    mym->fill_y_until(matrix, i); 
-  //     targetPalette[i] = CHSV(random8(), 255, 255); +    FastLED.show(); 
-  //   } +    FastLED.delay(30); 
-  // }+  }
  
-  // mym->fill(azul); 
-  // FastLED.show(); 
-  // delay(1000); 
-  // mym->fill(rojo); 
-  // FastLED.show(); 
-  // delay(1000); 
-  // mym->fill(maplv5); 
-  // FastLED.show(); 
-  // delay(1000); 
-  // mym->fill(maplv6); 
-  // FastLED.show(); 
-  // delay(1000); 
-  // mym->fill(maplv8); 
-  // FastLED.show(); 
-  // FastLED.delay(1000); 
-  // mym->fill(maplv10); 
-  // FastLED.show(); 
-  // FastLED.delay(1000); 
-  // mym->fill(matrix); 
-  // FastLED.show(); 
-  // FastLED.delay(1000); 
-  // mym->fill(verde); 
-  // mym->fill(raro, sshape); 
-  // FastLED.show(); 
-  // FastLED.delay(1000); 
-  FastLED.clear(); 
-  mym->fill_x(maplv1, 0); 
-  mym->fill_y(maplv1, 0); 
-  FastLED.show(); 
-  FastLED.delay(50); 
- 
-  FastLED.clear(); 
-  mym->fill_x(maplv2, 1); 
-  mym->fill_y(maplv2, 1); 
-  FastLED.show(); 
-  FastLED.delay(50); 
- 
-  FastLED.clear(); 
-  mym->fill_x(maplv3, 2); 
-  mym->fill_y(maplv3, 2); 
-  FastLED.show(); 
-  FastLED.delay(50); 
- 
-  FastLED.clear(); 
-  mym->fill_x(maplv4, 3); 
-  mym->fill_y(maplv4, 3); 
-  FastLED.show(); 
-  FastLED.delay(50); 
- 
-  FastLED.clear(); 
-  mym->fill_x(maplv5, 4); 
-  mym->fill_y(maplv5, 4); 
-  FastLED.show(); 
-  FastLED.delay(50); 
- 
-  FastLED.clear(); 
-  mym->fill_x(maplv6, 5); 
-  mym->fill_y(maplv6, 5); 
-  FastLED.show(); 
-  FastLED.delay(50); 
- 
-  FastLED.clear(); 
-  mym->fill_x(maplv8, 6); 
-  mym->fill_y(maplv8, 6); 
-  FastLED.show(); 
-  FastLED.delay(50); 
- 
-  FastLED.clear(); 
-  mym->fill_x(maplv10, 7); 
-  mym->fill_y(maplv10, 7); 
-  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://www.reddit.com/r/FastLED/wiki/index/user_examples   * https://www.reddit.com/r/FastLED/wiki/index/user_examples
 +  * https://connornishijima.github.io/Pixie_Chroma/?section=shortcodes
 +  * 
  
 ====== Contacto ====== ====== Contacto ======
proyectos/talleres/ets/recursos.1638389414.txt.gz · Última modificación: 2021/12/01 20:10 por brolin