Skip to content

Instantly share code, notes, and snippets.

@AbhishekGhosh
Last active November 5, 2015 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AbhishekGhosh/ded98481bd6c08019c57 to your computer and use it in GitHub Desktop.
Save AbhishekGhosh/ded98481bd6c08019c57 to your computer and use it in GitHub Desktop.
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