Skip to content

Instantly share code, notes, and snippets.

@youweit
Last active December 24, 2015 23:18
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 youweit/6878683 to your computer and use it in GitHub Desktop.
Save youweit/6878683 to your computer and use it in GitHub Desktop.
Arduino breath led!
#include <math.h>
void setup()
{
pinMode(11, OUTPUT);
}
void loop()
{
float val = (exp(sin(millis()/2000.0*PI)) - 0.365)*100.0;
analogWrite(11, val);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment