1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| int pinArr[] = {13,12,11,10}; int pinSize = sizeof(pinArr) / sizeof(int); int delayTime = 200; void setup() { for(int i=0; i<pinSize; i++) pinMode(pinArr[i], OUTPUT); }
void loop() { for(int i=0; i<pinSize; i++){ digitalWrite(pinArr[i], HIGH); delay(delayTime); digitalWrite(pinArr[i], LOW); delay(delayTime); } }
|