diff --git a/src/App/AppModLeds.h b/src/App/AppModLeds.h index 5dd2b9b7..0ac45811 100644 --- a/src/App/AppModLeds.h +++ b/src/App/AppModLeds.h @@ -29,6 +29,7 @@ class AppModLeds:public Module { public: unsigned long frameMillis = 0; unsigned long frameCounter = 0; + bool newFrame = false; //need to make these static as they are called in lambda functions static uint16_t fps; @@ -248,6 +249,8 @@ class AppModLeds:public Module { if(millis() - frameMillis >= 1000.0/fps) { frameMillis = millis(); + newFrame = true; + Effect* effect = effects[mdl->getValue("fx")]; effect->loop(); @@ -257,6 +260,9 @@ class AppModLeds:public Module { frameCounter++; call++; } + else { + newFrame = false; + } if (millis() - secondMillis >= 1000 || !secondMillis) { secondMillis = millis(); mdl->setValueV("realFps", "%lu /s", frameCounter); diff --git a/src/User/UserModArtNet.h b/src/User/UserModArtNet.h index f13f6337..ac855636 100644 --- a/src/User/UserModArtNet.h +++ b/src/User/UserModArtNet.h @@ -43,6 +43,8 @@ class UserModArtNet:public Module { if(!isConnected) return; + if(!lds->newFrame) return; + // calculate the number of UDP packets we need to send bool isRGBW = false; diff --git a/src/User/UserModDDP.h b/src/User/UserModDDP.h index 925e01dd..de1ecca4 100644 --- a/src/User/UserModDDP.h +++ b/src/User/UserModDDP.h @@ -59,6 +59,8 @@ class UserModDDP:public Module { if(!isConnected) return; + if(!lds->newFrame) return; + // calculate the number of UDP packets we need to send bool isRGBW = false;