I have a sketch whereby I use a counter to time certain effects (I'm using different LED lighting patterns) through the use of certain functions. In the sketch I define a counter and then I have the counter increase by 1 (counter ++) every time the sketch loops. With one of the functions below - bpm , the counter scrolls as expected, but with the other - "ebright", it progresses much slower - any idea why?
void ebright (){
for(int i = 0; i < NUM_LEDS; i++ ){
leds[i] = CHSV(m, 255, 255);
FastLED.show();
}
m=m+8;
if (m>255) {
m=1;
}
}
void bpm()
{
uint8_t BeatsPerMinute = 62;
CRGBPalette16 palette = PartyColors_p;
uint8_t beat = beatsin8( BeatsPerMinute, 64, 255);
for( int i = 0; i < NUM_LEDS; i++) {
leds[i] = ColorFromPalette(palette, gHue+(i*2), beat-gHue+(i*10));
}
}