nouvelles annimations

master
jblb 4 years ago
parent 992c2dbb78
commit 48311617f1

@ -66,7 +66,7 @@ void xmas(uint8_t wait){
delay(wait);
}
}
// change run_mod retur true si appuis cour
// change run_mod return true si appuis cour
boolean check_button(){
if (button1.checkPress() == 1) {
// SHORT PRESS!
@ -91,13 +91,31 @@ void setup()
}
void loop()
// put your main code here, to run repeatedly:
{
boolean breaked =false;
if (run_mod){
// put your main code here, to run repeatedly:
for (int i = 0; i < 5; i++) {
colorWipe_up(CRGB::Red, tempo_anim);
for (int i = 0; i < NUM_LEDS; i++) {
leds[i] = CRGB::Red;
FastSPI_LED.show();
delay(tempo_anim);
colorWipe_up(CRGB::Green, tempo_anim);
if (check_button()) {
breaked =true;
break;
}
}
delay(tempo_anim);
for (int i = 0; i < NUM_LEDS; i++) {
leds[i] = CRGB::Green;
FastSPI_LED.show();
delay(tempo_anim);
if (check_button()){
breaked =true;
break;
}
}
delay(tempo_anim);
if (breaked) break;
if (check_button()) break;
@ -115,9 +133,22 @@ if (run_mod){
if (check_button()) break;
}
}
if (run_mod){
int i =1;
int j= 0;
black_out();
for (int k = 0; k < NUM_LEDS*10 ; k++) {
leds[j] = CRGB::Red;
FastSPI_LED.show();
delay(tempo_anim/2);
leds[j] = CRGB::Black;
j= j+i;
if(j==NUM_LEDS- 1|| j==0) i= -i;
if (check_button()) break;
}
}
check_button();
black_out();
// delay(tempo_anim);
}

Loading…
Cancel
Save