void theme4 ()
{
Grower* grower1 = new Grower ( 0.0,
7,
led_strip.Color (5, 0, 0));
Grower* grower2 = new Grower ( 0.33,
7,
led_strip.Color (5, 0, 0));
Grower* grower3 = new Grower ( 0.66,
7,
led_strip.Color (5, 0, 0));
Wobbler* wobbler1 = new Wobbler ( 0.0,
8,
led_strip.Color (0, 5, 1));
wobbler1->speed = 0.6;
left_eye.add (grower1);
left_eye.add (grower2);
left_eye.add (grower3);
right_eye.add (wobbler1);
}
void theme6()
{
Pulsar* pulsarL1 = new Pulsar ( 0.0,
16,
led_strip.Color (1, 4, 0));
Wobbler* wobbleL1 = new Wobbler ( 0.0,
2,
led_strip.Color (5, 5, 0));
Wobbler* wobbleL2 = new Wobbler ( 0.5,
2,
led_strip.Color (5, 5, 0));
pulsarL1->speed = 0.5;
left_eye.add (pulsarL1);
left_eye.add (wobbleL1);
left_eye.add (wobbleL2);
Pulsar* pulsarR1 = new Pulsar ( 0.0,
8,
led_strip.Color (1, 4, 0));
Pulsar* pulsarR2 = new Pulsar ( 0.5,
8,
led_strip.Color (5, 5, 0));
pulsarR1->speed = 0.44;
pulsarR2->speed = 1.33;
right_eye.add (pulsarR1);
right_eye.add (pulsarR2);
}
void broken ()
{
Pulsar* pulsar1 = new Pulsar ( 0.5,
32,
led_strip.Color (5, 1, 1));
both_eyes.add (pulsar1);
}
void switch_every (uint16_t delay)
{
if(millis() - last_millis > delay)
{
last_millis = millis();
left_eye.unload_theme ();
right_eye.unload_theme ();
both_eyes.unload_theme ();
switch(current_theme)
{
case 0:
theme1 ();
break;
case 1:
theme2 ();
break;
case 2:
theme3 ();
break;
case 3:
theme4 ();
break;
case 4:
theme5 ();
break;
case 5:
theme6 ();
break;
default:
broken ();
break;
}
current_theme++;
current_theme %= 6;
}
}
}