Skip to content

Instantly share code, notes, and snippets.

@surinoel
Created July 8, 2019 05:08
Show Gist options
  • Save surinoel/546d56e26125d9bb70d819037dfec627 to your computer and use it in GitHub Desktop.
Save surinoel/546d56e26125d9bb70d819037dfec627 to your computer and use it in GitHub Desktop.
int pinLED =13;
int aPinLed[8] = {13, 12 ,11, 10, 9, 8, 7, 6};
void setup() {
// put your setup code here, to run once:
for(int i=0; i<8; i++) {
pinMode(aPinLed[i], OUTPUT);
}
}
void loop() {
// put your main code here, to run repeatedly:
for(int i=0; i<14; i++) {
int j;
if(!(i/8)) j = i;
else j = 6 - (i % 8);
digitalWrite(aPinLed[j], HIGH);
delay(1000);
digitalWrite(aPinLed[j], LOW);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment