Herramientas de usuario

Herramientas del sitio


proyectos:talleres:ets

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
Última revisiónAmbos lados, revisión siguiente
proyectos:talleres:ets [2023/10/03 13:44] – [Ejemplo básico] elmago116proyectos:talleres:ets [2023/10/03 13:48] – [Ejemplo básico] elmago116
Línea 96: Línea 96:
 <file c++ ejemplo.ino> <file c++ ejemplo.ino>
  
 +// Configurar - sujeto
 #include <FastLED.h> #include <FastLED.h>
 #define LED_PIN D3 #define LED_PIN D3
Línea 106: Línea 106:
 #define azul CRGB::Blue #define azul CRGB::Blue
 #define colornuevo 0x00FF00 #define colornuevo 0x00FF00
- 
  
 const uint8_t matrixWidth  = 8; const uint8_t matrixWidth  = 8;
Línea 118: Línea 117:
 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;
-  
-void setup() { 
-  Serial.begin(115200); 
-  LEDS.addLeds<LED_TYPE,LED_PIN,COLOR_ORDER>(leds,NUM_LEDS); 
-  FastLED.setBrightness(BRIGHTNESS); 
-} 
    
 #define ESCENAS 1 #define ESCENAS 1
Línea 138: Línea 131:
   },   },
 }; };
- + 
 +void setup() { 
 +  Serial.begin(115200); 
 +  LEDS.addLeds<LED_TYPE,LED_PIN,COLOR_ORDER>(leds,NUM_LEDS); 
 +  FastLED.setBrightness(BRIGHTNESS); 
 +
 + 
 +// Ejecutar en loop - predicado
 void loop() { void loop() {
 +// Pintar la matriz de leds
   for(int i = 0; i< matrixHeight; i++) {   for(int i = 0; i< matrixHeight; i++) {
     for(int j = 0; j< matrixWidth; j++) {     for(int j = 0; j< matrixWidth; j++) {
Línea 145: Línea 146:
     }     }
   }   }
 +  
   unsigned long startMillis = millis();  // Start of sample window   unsigned long startMillis = millis();  // Start of sample window
   unsigned int peakToPeak = 0;   unsigned int peakToPeak = 0;
proyectos/talleres/ets.txt · Última modificación: 2023/10/03 13:50 por elmago116