From 918ed57f1b11a3644b34ca56328755bc5d51c9ea Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Thu, 29 Jun 2023 21:13:27 +0100 Subject: [PATCH] Fix speedFactor midpoint --- usermods/usermod_v2_animartrix/usermod_v2_animartrix.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usermods/usermod_v2_animartrix/usermod_v2_animartrix.h b/usermods/usermod_v2_animartrix/usermod_v2_animartrix.h index df09e137..f8925c8a 100644 --- a/usermods/usermod_v2_animartrix/usermod_v2_animartrix.h +++ b/usermods/usermod_v2_animartrix/usermod_v2_animartrix.h @@ -67,7 +67,13 @@ class ANIMartRIXMod:public ANIMartRIX { if (SEGENV.call == 0) { init(SEGMENT.virtualWidth(), SEGMENT.virtualHeight(), false); } - float speedFactor = map(SEGMENT.speed, 0, 255, 1, 100) / 10; + float speedFactor = 1.0; + if (SEGMENT.speed < 128) { + speedFactor = map(SEGMENT.speed, 0, 127, 1, 10) / 10; + } + else{ + speedFactor = map(SEGMENT.speed, 128, 255, 10, 100) / 10; + } setSpeedFactor(speedFactor); } void setPixelColor(int x, int y, rgb pixel) {