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/04 23:20] – [Fanzine con manual de instalación] elmago116 | 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 179: | Línea 190: | ||
FIXME | FIXME | ||
- | ==== Librería | + | ==== Librería para escribir en la matriz ==== |
FIXME | FIXME | ||
- | <file c++ matrixlib.ino> | + | |
+ | <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 225: | 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 295: | 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 301: | 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 309: | 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 353: | 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(); | ||
} | } | ||
</ | </ | ||
- | |||
==== Diagrama electronico ===== | ==== Diagrama electronico ===== | ||
Línea 453: | Línea 390: | ||
* https:// | * https:// | ||
+ | * https:// | ||
+ | * | ||
====== Contacto ====== | ====== Contacto ====== |
proyectos/talleres/ets/recursos.1638660000.txt.gz · Última modificación: 2021/12/04 23:20 por elmago116