proyectos:vestuario_aqa
Diferencias
Muestra las diferencias entre dos versiones de la página.
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] kz | proyectos:vestuario_aqa [2019/12/03 01:53] – kz | ||
---|---|---|---|
Línea 208: | Línea 208: | ||
#include < | #include < | ||
FASTLED_USING_NAMESPACE | FASTLED_USING_NAMESPACE | ||
+ | |||
#if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000) | #if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000) | ||
#warning " | #warning " | ||
#endif | #endif | ||
- | + | ||
- | #define DATA_PIN | + | #define DATA_PIN |
- | #define CLK_PIN | + | #define CLK_PIN |
#define LED_TYPE | #define LED_TYPE | ||
#define COLOR_ORDER BGR | #define COLOR_ORDER BGR | ||
- | #define NUM_LEDS | + | #define NUM_LEDS |
#define BRIGHTNESS | #define BRIGHTNESS | ||
CRGB leds[NUM_LEDS]; | CRGB leds[NUM_LEDS]; | ||
+ | |||
int contador = 0; | int contador = 0; | ||
+ | |||
void setup() { | void setup() { | ||
FastLED.addLeds< | FastLED.addLeds< | ||
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< | for(int dot=0; dot< | ||
leds[dot] = CRGB:: | leds[dot] = CRGB:: | ||
FastLED.show(); | FastLED.show(); | ||
+ | delay(30); | ||
leds[dot] = CRGB:: | leds[dot] = CRGB:: | ||
- | FastLED.delay(10); | + | FastLED.delay(50); |
} | } | ||
- | + | | |
- | delay(300); | + | |
for(int dot=0; dot< | for(int dot=0; dot< | ||
leds[NUM_LEDS - dot] = CRGB:: | leds[NUM_LEDS - dot] = CRGB:: | ||
FastLED.show(); | FastLED.show(); | ||
+ | delay(30); | ||
leds[NUM_LEDS - dot] = CRGB:: | leds[NUM_LEDS - dot] = CRGB:: | ||
FastLED.delay(5); | FastLED.delay(5); | ||
} | } | ||
- | delay(2000); | + | delay(1000); |
} | } | ||
+ | |||
void HeartTired() { | void HeartTired() { | ||
for(int dot=0; dot< | for(int dot=0; dot< | ||
leds[dot] = CRGB::Red; | leds[dot] = CRGB::Red; | ||
FastLED.show(); | FastLED.show(); | ||
- | delay(30); | + | delay(15); |
leds[dot] = CRGB:: | leds[dot] = CRGB:: | ||
- | FastLED.delay(90); | + | FastLED.delay(10); |
} | } | ||
+ | |||
for(int dot=0; dot< | for(int dot=0; 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:: | leds[NUM_LEDS - dot] = CRGB:: | ||
- | FastLED.delay(10); | + | FastLED.delay(2); |
} | } | ||
- | delay(400); | + | delay(500); |
} | } | ||
proyectos/vestuario_aqa.txt · Última modificación: 2021/10/30 23:38 por kz