setSpeedFactor for animartrix

This commit is contained in:
Will Tatam
2023-06-29 12:16:17 +01:00
parent 3eed40331f
commit 417bef0026
2 changed files with 3 additions and 2 deletions

View File

@@ -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

View File

@@ -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");