Created
February 3, 2013 01:48
-
-
Save fchasen/4700196 to your computer and use it in GitHub Desktop.
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
/* | |
Fred Chasen | |
Pulse Light | |
*/ | |
// Connect to Pin 11, for analog | |
int led = 11; | |
int minamount = 5; | |
int x = minamount; | |
int sign = 1; | |
void setup() { | |
//Serial.begin(9600); | |
} | |
void loop() { | |
analogWrite(led, x); | |
delay(10); | |
x = x + sign; | |
if(x > 255 || x < minamount){ | |
sign = sign * -1; | |
} | |
//Serial.println(x); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment