Im sure im being entirely dense, and its probably a typical noob question.
im using FastLED.ShowColor(CRGB::BIGQUESTIONMARK)
all is working fine, but i’ve gotten to the point where i need to be able set the brightness using FastLED.setBrightness(CURRENT_BRIGHTNESS), which all worked fine with the older for[dot]loops, but i am attempting to remove all the older style for[dot] loops and have replaced them with the instant displaying FastLED.ShowColor(CRGB::BIGQUESTIONMARK). However, the brightness is not increaing until i set FastLED.ShowColor(CRGB::BIGQUESTIONMARK).
Is there a function that instantly updates the LEDs like Fastled.ShowColor but for instant update of the brightness? OR Is there a way of remembering the current set color that was previously called , i.e. FastLED.ShowColor(Recal This Part)? Ive tried putting CRGB::Red into a String then using the in place of (Recall This Part) that ended with a massive error. i hope this all makes sense.
best regards too all,
gregg
PS. For point of reference im using the latest fastled library, arduino mega 2560, 125 x ws2812b in a 5x5x5 cube formation, individually wired in to a 3d lattice(well, almost 3d), ch-05 bluetooth controlled via MIT App Inventor 2 App and hopefully Glediator realtime via a switch to knock out the RESET-EN on the arduino mega.
If you’re using FastLED.setBrightness in your main loop somewhere you might need to reorder where it’s located to make sure it’s always before FastLED.show().
I’m not sure I totally follow your question though. Feel free to post your code to http://gist.github.com and share the link here.
FastLED.setBrightness is a multiplier that is applied to whatever the pixels are set to at the time FastLED.show() is called. FastLED.setBrightness doesn’t update the display. Just like changing a pixel’s color doesn’t update the display. Only FastLED.show() will actually show any changes you’ve made since the last time show() was called.
Thank you for your rapid response Marc.
Im using select and case statements controlled from bluetooth serial
so if 49 is received it uses FastLED.ShowColor(CRGB::Red).
Maybe i should rephrase the question a little, How can i set the (CRGB::Red) from a static value, ie. A=CRGB::Red, so i can use
FastLED.ShowColor(A), this way i should be able to just use the
FastLED.setBrightness(CURRENT_BRIGHTNESS) followed by
FastLED.ShowColor(A) to remember what colour is currently displayed.
i hope this all makes sense, i dont really want to post my source code, just because its such a mess, annotations everywhere, well it is a big learning curve for me.
There are several ways this could be arranged, but perhaps something like this:
…
case 49: {
CRGB A = CRGB::Red; // set color A
FastLED.setBrightness(42); // set new brightness
break;
}
…
fill_solid(leds, NUM_LEDS, A); //fill strip with color A
FastLED.show(); // update the display
You could also set your variable current_brightness = 42 inside the case block, and then later have:
fill_solid(leds, NUM_LEDS, A); //fill strip with color A
FastLED.setBrightness(current_brightness); // set brightness
FastLED.show(); // update the display
Don’t worry about posting your code. We all had to learn in the beginning. You might get some great suggestions from the friendly group here.
Thanks Marc, i will try that as soon as im able, but it looks like its exactly what i was trying to fathom, CRGB A=, should help no end across the project.
regards,
gregg
ps, i will share my source for this project as soon as its worth sharing. once again thank you.