Hello, I have been testing the same FastLED code on an Adafruit Flora board which seems to work great and an Adafruit Feather M0 which is supposed to be more powerful and a few of the FastLED functions (bpm, juggle, sinelon which all use the beatsin function) seem to be extremely slow. This is connected to a 2m 60led/m strip, so 120leds total.
I've taken out the delay code fully on these functions when running on the Feather and it's still much slower than on the Flora. I can increase the numbers in the beatsin functions to a certain extent to speed them up but even the look or spread of some of the lights like on juggle look different.
Is the best option to just try to tweak the functions individually or is there a more universal way to address the slow down on the Feather?
void fastLEDBpm() {
// colored stripes pulsing at a defined Beats-Per-Minute (BPM)
uint8_t BeatsPerMinute = 64;
CRGBPalette16 palette = PartyColors_p;
uint8_t beat = beatsin8( BeatsPerMinute, 64, 255);
for( int i = 0; i < NUM_LEDS; i++) { //9948
leds[i] = ColorFromPalette(palette, gHue+(i*2), beat-gHue+(i*10));
}
// send the 'leds' array out to the actual LED strip
FastLED.show();
// insert a delay to keep the framerate modest
FastLED.delay(1000/FRAMES_PER_SECOND);
// do some periodic updates
EVERY_N_MILLISECONDS( 20 ) { gHue++; } // slowly cycle the "base color" through the rainbow
// Check for inloop button press (include this to every effect loop)
oldState = newState;
checkInLoopPress();
if (InLoopPress == 1) {
InLoopPress = 0;
}
}
void fastLEDJuggle() {
// eight colored dots, weaving in and out of sync with each other
fadeToBlackBy( leds, NUM_LEDS, 20);
byte dothue = 0;
for( int i = 0; i < 8; i++) {
leds[beatsin16(i+7,0,NUM_LEDS)] |= CHSV(dothue, 200, 255);
dothue += 32;
}
// send the 'leds' array out to the actual LED strip
FastLED.show();
// insert a delay to keep the framerate modest
FastLED.delay(1000/FRAMES_PER_SECOND);
// do some periodic updates
EVERY_N_MILLISECONDS( 20 ) { gHue++; } // slowly cycle the "base color" through the rainbow
// Check for inloop button press (include this to every effect loop)
oldState = newState;
checkInLoopPress();
if (InLoopPress == 1) {
InLoopPress = 0;
}
}
void fastLEDSinelon() {
// a colored dot sweeping back and forth, with fading trails
fadeToBlackBy( leds, NUM_LEDS, 20);
int pos = beatsin16(13,0,NUM_LEDS);
leds[pos] += CHSV( gHue, 255, 192);
// send the 'leds' array out to the actual LED strip
FastLED.show();
// insert a delay to keep the framerate modest
FastLED.delay(1000/FRAMES_PER_SECOND);
// do some periodic updates
EVERY_N_MILLISECONDS( 20 ) { gHue++; } // slowly cycle the "base color" through the rainbow
// Check for inloop button press (include this to every effect loop)
oldState = newState;
checkInLoopPress();
if (InLoopPress == 1) {
InLoopPress = 0;
}
}