int pins[] = {2, 3, 4, 5, 6, 7, 8, 9};
int timer = 75;
void setup() {
// Release 3/4 from JTAG to allow GPIO use while keeping SWD active
for (int i = 0; i < 8; i++) {
pinMode(pins[i], OUTPUT);
}
}
void loop() {
for (int i = 0; i < 8; i++) {
digitalWrite(pins[i], HIGH);
delay(timer);
digitalWrite(pins[i], LOW);
}
for (int i = 6; i >= 1; i--) {
digitalWrite(pins[i], HIGH);
delay(timer);
digitalWrite(pins[i], LOW);
}
}