I’m using the https://www.sparkfun.com/products/13664 SAMD21 Mini Breakout with Lumenati 8-pack and 8-stick, using the FastLED library. My fading (blue->black) code works fine for all the LEDs:
uint8_t x;
uint16_t sh_wait=29;
for (x=0;x<NUM_LEDS;x++) {
leds[x]=CRGB::Blue;
}
for (x=45;x>=6;x--) {
FastLED.setBrightness(x);
FastLED.show();
delay(sh_wait);
}
What I now want to do is to keep 4 selected LEDs on stable white, while the other LEDs do the fading loop.
I can set the 4 selected LEDs to white:
leds[9]=leds[10]=leds[14]=leds[15]=CRGB::White;
but later on, setBrightness works on all LEDs. To fade only the non-selected LEDs I need to address their brightness individually or as a subset. How do I do this? Thanks.
You need to create a new variable for the different grouping(s); say maybe setBrightness1 * setBrightness2 and assign the variable to control the relevant LEDs
Thanks for the reply. The issue wasn’t how to manage brightness variables (that’s easy), but how to address the brightness of individual LEDs, as opposed to the brightness of all the LEDs at the same time, which is what setBrightness() does. Anyway, I found the answer elsewhere.
I have another question about the SAMD21G board itself, but I can’t find a relevant forum to ask. Under “Sparkfun products” I don’t see “Microprocessor boards”. Please point me to the right forum, if it exists.
The question is how to get Serial Monitor in Arduino’s IDE to work with this board for debugging purposes. I have hooked up the LEDs per this guide https://learn.sparkfun.com/tutorials/lu … okup-guide, so pins 11 & 13 are taken. In Arduino’s IDE Sparkfun SAMD Mini Board is on the right COM and it works. When I try to add “Serial.begin(9600)” to the “setup()” and Serial.print(“test”) to the “loop()”, there’s no output in the Serial Monitor, even though the the LED-related code works. The Serial Monitor is is on the right COM port / baud. From the comments at the bottom I see that this is a common issue. https://www.sparkfun.com/products/13664. Clicking “Reset” after uploading the code doesn’t help.