Created
June 11, 2013 20:03
-
-
Save flyingoctopus/5760128 to your computer and use it in GitHub Desktop.
macbook-like breathing algo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@vhs might find this useful