Skip to content

Instantly share code, notes, and snippets.

@flyingoctopus
Created June 11, 2013 20:03
Show Gist options
  • Save flyingoctopus/5760128 to your computer and use it in GitHub Desktop.
Save flyingoctopus/5760128 to your computer and use it in GitHub Desktop.
macbook-like breathing algo.
#include <math.h>
void setup()
{
pinMode(11, OUTPUT);
}
void loop()
{
float val = (exp(sin(millis()/2000.0*PI)) - 0.36787944)*108.0;
analogWrite(11, val);
}
@flyingoctopus
Copy link
Author

@vhs might find this useful

@flyingoctopus
Copy link
Author

;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment