Herramientas de usuario

Herramientas del sitio


proyectos:vestuario_aqa

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ónAmbos lados, revisión siguiente
proyectos:vestuario_aqa [2019/12/01 19:17] – [Código para el proyecto del corazon] kzproyectos:vestuario_aqa [2019/12/03 01:53] kz
Línea 208: Línea 208:
 #include <FastLED.h> #include <FastLED.h>
 FASTLED_USING_NAMESPACE FASTLED_USING_NAMESPACE
 + 
 #if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000) #if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000)
 #warning "Requires FastLED 3.1 or later; check github for latest code." #warning "Requires FastLED 3.1 or later; check github for latest code."
 #endif #endif
- +  
-#define DATA_PIN    D2 +#define DATA_PIN    D6 
-#define CLK_PIN     D1+#define CLK_PIN     D5
 #define LED_TYPE    DOTSTAR #define LED_TYPE    DOTSTAR
 #define COLOR_ORDER BGR #define COLOR_ORDER BGR
-#define NUM_LEDS    105+#define NUM_LEDS    23
 #define BRIGHTNESS  96 #define BRIGHTNESS  96
 CRGB leds[NUM_LEDS]; CRGB leds[NUM_LEDS];
 + 
 int contador = 0; int contador = 0;
 + 
 void setup() { void setup() {
     FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);     FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
Línea 228: Línea 228:
     Serial.begin(115200);     Serial.begin(115200);
 } }
 + 
 void loop() { void loop() {
   contador++;                                                                               contador++;                                                                            
 + 
   if (contador < 10) {   if (contador < 10) {
     normalHeart();     normalHeart();
Línea 237: Línea 237:
     HeartTired();     HeartTired();
   }   }
 + 
   if (contador > 20) { contador = 0; }   if (contador > 20) { contador = 0; }
   Serial.println(contador);   Serial.println(contador);
-  + 
 } }
 + 
 void normalHeart() { void normalHeart() {
     for(int dot=0; dot<NUM_LEDS+1; dot++) {     for(int dot=0; dot<NUM_LEDS+1; dot++) {
       leds[dot] = CRGB::Green;       leds[dot] = CRGB::Green;
       FastLED.show();       FastLED.show();
 +      delay(30);
       leds[dot] = CRGB::Black;       leds[dot] = CRGB::Black;
-      FastLED.delay(10);+      FastLED.delay(50);
     }     }
- +  
-    delay(300); +
     for(int dot=0; dot<NUM_LEDS+1; dot++) {     for(int dot=0; dot<NUM_LEDS+1; dot++) {
       leds[NUM_LEDS - dot] = CRGB::Green;       leds[NUM_LEDS - dot] = CRGB::Green;
       FastLED.show();       FastLED.show();
 +      delay(30);
       leds[NUM_LEDS - dot] = CRGB::Black;       leds[NUM_LEDS - dot] = CRGB::Black;
       FastLED.delay(5);       FastLED.delay(5);
     }     }
-    delay(2000);+    delay(1000);
 } }
 + 
 void HeartTired() { void HeartTired() {
     for(int dot=0; dot<NUM_LEDS+1; dot++) {     for(int dot=0; dot<NUM_LEDS+1; dot++) {
       leds[dot] = CRGB::Red;       leds[dot] = CRGB::Red;
       FastLED.show();       FastLED.show();
-      delay(30);+      delay(15);
       leds[dot] = CRGB::Black;       leds[dot] = CRGB::Black;
-      FastLED.delay(90);+      FastLED.delay(10);
     }     }
 + 
     for(int dot=0; dot<NUM_LEDS+1; dot++) {     for(int dot=0; dot<NUM_LEDS+1; dot++) {
       leds[NUM_LEDS - dot] = CRGB::Red;       leds[NUM_LEDS - dot] = CRGB::Red;
       FastLED.show();       FastLED.show();
-      delay(30);+      delay(15);
       leds[NUM_LEDS - dot] = CRGB::Black;       leds[NUM_LEDS - dot] = CRGB::Black;
-      FastLED.delay(10);+      FastLED.delay(2);
     }     }
-    delay(400);+    delay(500);
 } }
  
proyectos/vestuario_aqa.txt · Última modificación: 2021/10/30 23:38 por kz