@@ -296,30 +296,29 @@ void setup() {
prev_time = millis();
}
void loop() {
Rings.Update();
/*
* We could store the return of the first millis call in a variable.
* But this routine is fast, so we only loose some milliseconds (if even)
* and we are not that time critical, that the MODE changes extacly after
* MODE_CHANGE_TIME. Calling millis twice, saves us 8 bytes, which is critical
* for the small storage space we have.
*/
We could store the return of the first millis call in a variable.
But this routine is fast, so we only loose some milliseconds (if even)
and we are not that time critical, that the MODE changes extacly after
MODE_CHANGE_TIME. Calling millis twice, saves us 8 bytes, which is critical
for the small storage space we have.
if ((millis() - prev_time) >= MODE_CHANGE_TIME) {
mode = random(0, 9);
void RingsComplete()
{
void RingsComplete() {
uint16_t slow_interval = random(SLOW_INTERVAL_MIN, SLOW_INTERVAL_MAX + 1);
uint16_t steps = random(STEPS_MIN, STEPS_MAX + 1);
uint32_t color = Rings.Wheel(random(COLOR_MIN, COLOR_MAX + 1));
switch (mode) {
case 0:
Rings.RainbowCycle(random(RAINBOW_CYCLE_MIN_INTERVAL, RAINBOW_CYCLE_MAX_INTERVAL + 1));
break;
case 1:
Rings.ColorWipe(color, slow_interval);