« Long time no blog! | Home | Arduino: 4 button piezo synth (failed) »
Arduino: i can haz knight riders!
By booyaa | January 29, 2008
You need to go to my blog post to see the video above. Does appear to render in RSS…
Please excuse the poorly formatted code, I will be using a real pretty pretty code printer real soon!
// making a series of leds light up individually ala knight rider
int sleep = 100;
int ledPin = 1;
int maxPins = 6;
int startPin = 1;
void setup() {
for( ledPin=1; ledPin<maxPins; ledPin++) {
pinMode(ledPin, OUTPUT);
}
}
void loop() {
for( ledPin=1; ledPin<maxPins; ledPin++) {
digitalWrite(ledPin, HIGH);
delay(sleep);
digitalWrite(ledPin, LOW);
//delay(sleep);
}
for( ledPin=4; ledPin>startPin; ledPin--) {
digitalWrite(ledPin, HIGH);
delay(sleep);
digitalWrite(ledPin, LOW);
//delay(sleep);
}
}
Topics: Uncategorized |

Blog