Last active
December 24, 2015 23:18
-
-
Save youweit/6878683 to your computer and use it in GitHub Desktop.
Arduino breath led!
This file contains 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.365)*100.0; | |
analogWrite(11, val); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment