Skip to content

Extend configurability for Analog Clock overlay #5285

@erkum

Description

@erkum

Is your feature request related to a problem? Please describe.

I am in the process of building a clock which uses two segments.

  • One for Minutes and Seconds (60 LEDs)
  • One for Hours (36 LEDs)

My wish is now that the Minutes and Seconds have one pixel for minutes and seconds respectively.
The hours however, I'd like them to be 3 Pixes per hour.

I'd implement this feature myself but before I'd like to check with you guys if this would be the correct approach and if you'd even want such a feature.

Describe the solution you'd like

In overlay mode:

  • I'd like to be able to set different LED ranges and pixel widths for Hours, Minutes and Seconds
    • e.g. 60 LEDs for Minutes and Seconds and 36 LEDs for Hours with a width of 3 LEDs per hour
  • I'd like to configure the color for Hours, Minutes and Seconds
  • I'd like to set the brightness

I looked around and found a possible solution:

In wled.h:
Remove

WLED_GLOBAL uint16_t overlayMin _INIT(0), overlayMax _INIT(DEFAULT_LED_COUNT - 1);   // boundaries of overlay mode

and replace it with

WLED_GLOBAL uint16_t overlayHourStartPx _INIT(0), overlayHourEndPx _INIT(DEFAULT_LED_COUNT - 1);   // boundaries of overlay mode for Hours
WLED_GLOBAL uint16_t overlayMinuteStartPx _INIT(0), overlayMinuteEndPx _INIT(DEFAULT_LED_COUNT - 1);   // boundaries of overlay mode for Minutes
WLED_GLOBAL uint16_t overlaySecondStartPx _INIT(0), overlaySecondEndPx _INIT(DEFAULT_LED_COUNT - 1);   // boundaries of overlay mode for Seconds
WLED_GLOBAL byte overlayHourPxWidth _INIT(1), overlayMinutePxWidth _INIT(1), overlaySecondPxWidth _INIT(1); // the amount of pixels to light up per Hour/Minute/Second in overlay mode
WLED_GLOBAL uint32_t overlayColorHour _INIT(0x0000FF), overlayColorMinute _INIT(0x00FF00), overlayColorSecond _INIT(0xFF0000); // the colors for Hour/Minute/Second in overlay mode
WLED_GLOBAL byte overlayBrightness _INIT(128); // the brightness of the leds in overlay mode.

add the config options to the web ui and adapt overlay.cpp.

Combining Minutes and Seconds into overlayMinSecStartPx and overlayMinSecEndPx would be possible and sufficient for this specific use-case since they both are 60. Would consume less ram but isn't very nice in my opinion. But also I do not know how much ram could be sacrificed on this feature and how much headroom there is.

This feature would be a breaking change. I am unsure if this is a big problem.
A solution for that would be to keep overlayMin and overlayMax and extend it with 'advanced settings'. Though this would generate overhead.
Maybe there are options for migrating?

Looking forward to your opinion on this.

Describe alternatives you've considered

  • Implementing this hardcoded, only for myself for this specific use-case and having a hard time updating - nah.
  • Maybe segments and presets could integrate into this but I am not sure about that

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions