Last active
December 10, 2015 10:38
-
-
Save vividvilla/4422042 to your computer and use it in GitHub Desktop.
LED Fading Effect using Arduino – just like your Sleeping Mac - http://www.electronicsblog.org/led-fading-effect-using-arduino/
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
const int LED = 9; | |
int i = 0; | |
void setup() | |
{ | |
pinMode(LED, OUTPUT); | |
} | |
void loop() | |
{ | |
for (i = 0; i < 255; i++) | |
{ | |
analogWrite(LED, i); delay(10); | |
} | |
for (i = 255; i > 0; i--) | |
{ | |
analogWrite(LED, i); | |
delay(10); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment