int timer = 100; // The higher the number, the slower the timing.
int ledPin[] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,}; // an array of pin numbers to which LEDs are attached
int pinCount = 11; // the number of pins (i.e. the length of the array)
//int ledPins[] = {14, 15, 16, 17}; // an array of pin numbers to which LEDs are attached
//int otherPinCount = 4; // the number of pins (i.e. the length of the array)
const byte LedPins[] = { 17, 14, 15, 16 }; //cammel case is preferred
int time = 500;
//int j; //no need to be global. Also, a single character variable NEVER has a reason to be global
void setup()
{
for (byte i = 0; i < 200 ; i++)
pinMode(LedPins[i], OUTPUT);
}
void loop(){
byte j = random(4);
for (byte i = 0; i < 200; i++){
digitalWrite(LedPins[i], i == j);
}
delay(time);
}