Merge remote-tracking branch 'origin/dev' into mdev

This commit is contained in:
Ewowi
2022-10-01 12:05:49 +02:00
19 changed files with 604 additions and 272 deletions

View File

@@ -114,8 +114,8 @@ class Animated_Staircase : public Usermod {
// We may need to copy mode and colors from segment 0 to make sure
// changes are propagated even when the config is changed during a wipe
// segments->mode = mainsegment.mode;
// segments->colors[0] = mainsegment.colors[0];
// seg.setMode(mainsegment.mode);
// seg.setColor(0, mainsegment.colors[0]);
} else {
seg.setOption(SEG_OPTION_ON, false);
}

View File

@@ -531,11 +531,11 @@ public:
for (byte i=0; i<strip.getSegmentsNum(); i++) {
Segment& seg = strip.getSegment(i);
if (!seg.isActive()) continue;
strip.setMode(i, effectCurrent);
seg.setMode(effectCurrent);
}
} else {
//Segment& seg = strip.getSegment(strip.getMainSegmentId());
strip.setMode(strip.getMainSegmentId(), effectCurrent);
Segment& seg = strip.getSegment(strip.getMainSegmentId());
seg.setMode(effectCurrent);
}
lampUdated();
#ifdef USERMOD_FOUR_LINE_DISPLAY
@@ -661,11 +661,11 @@ public:
for (byte i=0; i<strip.getSegmentsNum(); i++) {
Segment& seg = strip.getSegment(i);
if (!seg.isActive()) continue;
seg.palette = effectPalette;
seg.setPalette(effectPalette);
}
} else {
Segment& seg = strip.getSegment(strip.getMainSegmentId());
seg.palette = effectPalette;
seg.setPalette(effectPalette);
}
lampUdated();
#ifdef USERMOD_FOUR_LINE_DISPLAY

View File

@@ -1,11 +1,12 @@
# Word Clock Usermod V2
This usermod can be used to drive a wordclock with a 11x10 pixel matrix with WLED. There are also 4 additional dots for the minutes.
The visualisation is desribed in 4 mask with LED numbers (single dots for minutes, minutes, hours and "clock/Uhr").
There are 2 parameters to chnage the behaviour:
The visualisation is desribed in 4 mask with LED numbers (single dots for minutes, minutes, hours and "clock/Uhr"). The index of the LEDs in the masks always starts with the index 0, even if the ledOffset is not 0.
There are 3 parameters to change the behaviour:
active: enable/disable usermod
diplayItIs: enable/disable display of "Es ist" on the clock.
diplayItIs: enable/disable display of "Es ist" on the clock
ledOffset: number of LEDs before the wordclock LEDs
## Installation

View File

@@ -23,6 +23,7 @@ class WordClockUsermod : public Usermod
// set your config variables to their boot default value (this can also be done in readFromConfig() or a constructor if you prefer)
bool usermodActive = false;
bool displayItIs = false;
int ledOffset = 100;
// defines for mask sizes
#define maskSizeLeds 114
@@ -358,6 +359,7 @@ class WordClockUsermod : public Usermod
JsonObject top = root.createNestedObject("WordClockUsermod");
top["active"] = usermodActive;
top["displayItIs"] = displayItIs;
top["ledOffset"] = ledOffset;
}
/*
@@ -386,6 +388,7 @@ class WordClockUsermod : public Usermod
configComplete &= getJsonValue(top["active"], usermodActive);
configComplete &= getJsonValue(top["displayItIs"], displayItIs);
configComplete &= getJsonValue(top["ledOffset"], ledOffset);
return configComplete;
}
@@ -407,7 +410,7 @@ class WordClockUsermod : public Usermod
if (maskLedsOn[x] == 0)
{
// set pixel off
strip.setPixelColor(x, RGBW32(0,0,0,0));
strip.setPixelColor(x + ledOffset, RGBW32(0,0,0,0));
}
}
}