Skip to content

Instantly share code, notes, and snippets.

@daz
Created January 7, 2019 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daz/b2d1404461d8977c26906e481102c5ae to your computer and use it in GitHub Desktop.
Save daz/b2d1404461d8977c26906e481102c5ae to your computer and use it in GitHub Desktop.
uint8_t breathBrightness = (exp(sin(millis() / (float)breathRate * PI)) - 0.36787944) * 108.0;
uint8_t brightness = constrain(map(breathBrightness, 0, 250, 80, 255), 0, 255);
leds[0] = CHSV(hue, 255, brightness);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment