Skip to content

Instantly share code, notes, and snippets.

@fchasen
Created February 3, 2013 01:48
Show Gist options
  • Save fchasen/4700196 to your computer and use it in GitHub Desktop.
Save fchasen/4700196 to your computer and use it in GitHub Desktop.
/*
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