@@ -300,10 +300,16 @@ void setup() {
void loop() {
Rings.Update();
uint32_t t = millis();
if ((t - prev_time) >= MODE_CHANGE_TIME) {
/*
* 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);
prev_time = t;
prev_time = millis();
}