From 417bef002619e0116f68071cd5519a0b8e2056da Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Thu, 29 Jun 2023 12:16:17 +0100 Subject: [PATCH] setSpeedFactor for animartrix --- platformio.ini | 2 +- usermods/usermod_v2_animartrix/usermod_v2_animartrix.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index ab772ced..55564210 100644 --- a/platformio.ini +++ b/platformio.ini @@ -925,7 +925,7 @@ lib_deps_M = OneWire@~2.3.5 ; used for USERMOD_FOUR_LINE_DISPLAY and USERMOD_DALLASTEMPERATURE olikraus/U8g2 @ ^2.28.8 ; used for USERMOD_FOUR_LINE_DISPLAY ElectronicCats/MPU6050 @ 0.6.0 ; used for USERMOD_MPU6050_IMU - https://github.com/netmindz/animartrix.git#d7c1896166f13fec2917c305222a77e3b504d060 + https://github.com/netmindz/animartrix.git#65bcfc5410464fc9721dd13d11a0e29eaf7a94e5 lib_deps_V4_M = ;https://github.com/blazoncek/OneWire.git ; includes bugfixes for inconsistent readings diff --git a/usermods/usermod_v2_animartrix/usermod_v2_animartrix.h b/usermods/usermod_v2_animartrix/usermod_v2_animartrix.h index 2e229c23..150613a7 100644 --- a/usermods/usermod_v2_animartrix/usermod_v2_animartrix.h +++ b/usermods/usermod_v2_animartrix/usermod_v2_animartrix.h @@ -67,7 +67,7 @@ class ANIMartRIXMod:public ANIMartRIX { if (SEGENV.call == 0) { init(SEGMENT.virtualWidth(), SEGMENT.virtualHeight(), false); } - float speedFactor = map(source, 0, 255, 1, 100) / 10; + float speedFactor = map(SEGMENT.speed, 0, 255, 1, 100) / 10; setSpeedFactor(speedFactor); } void setPixelColor(int x, int y, rgb pixel) { @@ -420,6 +420,7 @@ class AnimartrixUsermod : public Usermod { void addToJsonInfo(JsonObject& root) { + if(!enabled) return; char myStringBuffer[16]; // buffer for snprintf() JsonObject user = root["u"]; if (user.isNull()) user = root.createNestedObject("u");