Closed AndrewdAzotus closed 2 years ago
You can already set brightness using brightness function, where you call it like this: strip.brightness(<brightness value on interval 0 to 255>)
Is there a reason this doesn't do what you intended, because to me it looks like you could just use that.
When the brightness function is used, it sets the brightness for all future set_pixel calls. Adding the howBright parameter enables that default brightness to be overridden for that one single set_pixel rather than the program having to remember or retrieve the current brightness, change it to a different value, set a single pixel, then change the brightness back to its original value.
I thought it helped and made coding easier when calling set_pixel.
I have an existing fade candy where I 'ripple' a single pixel along the length of neoPixel strips by making it brighter than the default 'background' brightness then setting it back after a momentary delay and moving onto the next one.
HTH,
Yeah, I imagined it could be something like this. I will test this out tomorrow, but since the code seems backwards compatible, I'll most likely merge.
Thank you. I was careful to ensure backwards compatibility; it can be a nightmare when new code breaks old implementations.
Amended to allow pixels to be set at non-default brightness