From 3eed40331fbd76eb99f764fc7ecfc0c6097f0da5 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Thu, 29 Jun 2023 12:04:38 +0100 Subject: [PATCH] setSpeedFactor in animartrix --- platformio.ini | 2 +- usermods/usermod_v2_animartrix/usermod_v2_animartrix.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 6702b8de..ab772ced 100644 --- a/platformio.ini +++ b/platformio.ini @@ -932,7 +932,7 @@ lib_deps_V4_M = paulstoffregen/OneWire@ ^2.3.7 ; used for USERMOD_DALLASTEMPERATURE -> need newer release with bugfixes for -S3; still requires TEMPERATURE_PIN < 46 olikraus/U8g2@ ^2.34.5 ; used for USERMOD_FOUR_LINE_DISPLAY -> need newer version with bugfixes for arduino-esp32 v2.0.4 (Wire inititialization) ElectronicCats/MPU6050 @ 0.6.0 ; used for USERMOD_MPU6050_IMU - https://github.com/netmindz/animartrix.git#d7c1896166f13fec2917c305222a77e3b504d060 + https://github.com/netmindz/animartrix.git#65bcfc5410464fc9721dd13d11a0e29eaf7a94e5 build_flags_XL = -D USERMOD_BH1750 diff --git a/usermods/usermod_v2_animartrix/usermod_v2_animartrix.h b/usermods/usermod_v2_animartrix/usermod_v2_animartrix.h index 6d368e8f..2e229c23 100644 --- a/usermods/usermod_v2_animartrix/usermod_v2_animartrix.h +++ b/usermods/usermod_v2_animartrix/usermod_v2_animartrix.h @@ -67,6 +67,8 @@ class ANIMartRIXMod:public ANIMartRIX { if (SEGENV.call == 0) { init(SEGMENT.virtualWidth(), SEGMENT.virtualHeight(), false); } + float speedFactor = map(source, 0, 255, 1, 100) / 10; + setSpeedFactor(speedFactor); } void setPixelColor(int x, int y, rgb pixel) { SEGMENT.setPixelColorXY(x, y, CRGB(pixel.red, pixel.green, pixel.blue));