Created
April 6, 2012 17:38
-
-
Save lancelakey/2321570 to your computer and use it in GitHub Desktop.
arduino pulse LED
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
| const int LED = 3; | |
| void setup() | |
| { | |
| pinMode(LED, OUTPUT); | |
| } | |
| void loop() | |
| { | |
| for (int i = 0; i<=255; i++) | |
| { | |
| analogWrite(LED,i*i/256); | |
| delay(10); | |
| } | |
| for (int i = 255; i>=0; i--) | |
| { | |
| analogWrite(LED,i*i/256); | |
| delay(10); | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment