Skip to content

Adjusting overall brightness seems to be slow. #372

@cultur98

Description

@cultur98

Great Library which gives me all the options I was looking for!

Especially dealing with segments is very convenient.
However the setBrightness() method seems to be very slow.

At least I fail to smoothly change the brightness of the pixels
using this function. Here every 10 milliseconds.
Variable the_bright is a value I read from an ambient light sensor.

void NeoPixelArray::loop(int dim_time) {
  unsigned long the_millis = millis();
  if((the_millis - update_time) >= 10)  {
    if (dim_time == 0) {
      the_bright = bright;
      ws2812fx->setBrightness(the_bright);
    } else if(the_bright < bright) {
      the_bright++;
      ws2812fx->setBrightness(the_bright);
    } else if(the_bright > bright) {
      the_bright--;
      ws2812fx->setBrightness(the_bright);
    }
    update_time = the_millis;
  ws2812fx->service();
}

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions