Skip to content

Support single-color multi-chip brightness variations #20

Closed

Description

@PaulMcMillan

I have some (admittedly uncommon) LPD8806 strip with 3-die warm white LEDs on it. The library works well with this strip, but I would like to increase my available brightness resolution by dithering one high-resolution brightness value across the 3 dies (the 8806 only supports 7 bits per channel). My present approach for this this involves more math per pixel than makes sense.

It would be helpful if the library included support directly for something like this.

Activity

  1. focalintent commented on Feb 2, 2014

    @focalintent
    Contributor

    Actually do the three lines of math separately - you don't want the overhead of running a loop in there (you're adding at least 20 cycles of overheard if you do that!)

  2. focalintent commented on Feb 3, 2014

    @focalintent
    Contributor

    Note - I'm unlikely to add something special purpose like this to the library (as its primary focus is in dealing with RGB chipsets). However, if you want a conversion function, you can have something like:

    // val is a value from 0-767 -- note, use 0-255 values for RGB values, the library, internally,
    // does the 7-bit cut, but if you really want 7 bit values, you can change appropriately here)
    inline CRGB threeWayDither(uint16_t val) {
    return CRGB(val/3, (val+1)/3, (val+2)/3);
    }

    make it inline and the compiler should keep it pretty tight/fast[1]. (Also, there really isn't much of a way that I could implement this at a lower level in the library that would be much different from this).

    [1] with the caveat that AVR is -terrible- at doing division.

  3. PaulMcMillan commented on Feb 7, 2014

    @PaulMcMillan
    Author

    Cool, thanks for the suggestions, I'll give 'em a shot. I guess you're right - this is probably a little too unique for an RGB oriented library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions