Skip to content

Instantly share code, notes, and snippets.

@AbhishekGhosh AbhishekGhosh/chase1.cc
Last active Nov 5, 2015

Embed
What would you like to do?
Arduino LED Chase I
const int number = 11;
const byte order [number] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
void setup() {
for (byte i = 0; i < number; i++)
pinMode(order [i], OUTPUT);
}
void repeat (const unsigned long delaytime)
{
for (byte i = 0; i < number; i++)
{
byte pin = order [i];
digitalWrite(pin, HIGH);
delay(delaytime);
digitalWrite(pin, LOW);
}
}
void loop()
{
for (unsigned long n = 500; n > 0; n -= 100)
repeat (n);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.