Skip to content

Instantly share code, notes, and snippets.

@nervusvagus
Created May 21, 2022 20:30
Show Gist options
  • Save nervusvagus/64df9d3ab19f978ddc28ee1218114382 to your computer and use it in GitHub Desktop.
Save nervusvagus/64df9d3ab19f978ddc28ee1218114382 to your computer and use it in GitHub Desktop.
void confettiandsinelon()
{
// a colored dot sweeping back and forth, with fading trails
fadeToBlackBy( leds, NUM_LEDS, 10);
int pos1 = beatsin16(4, 0, NUM_LEDS - 1); //beats_per_minute, uint16_t lowest=0, uint16_t highest=65535, uint32_t timebase=0, uint16_t phase_offset=0
leds[pos1] += CHSV( gHue, 255, 192);
int pos2 = random16(NUM_LEDS);
int pos3 = random16(NUM_LEDS);
int pos4 = random16(NUM_LEDS);
EVERY_N_MILLIS(200) {
leds[pos2] += CHSV( gHue + random8(64), 200, 255);
leds[pos3] += CHSV( gHue + random8(64), 200, 255);
leds[pos4] += CHSV( gHue + random8(64), 200, 255);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment