I (once again) thought this would be easy but its late and Im getting tired 8)
All I want to do is run a loop to blink 3 LEDs in random ways: … seemed easy but it doesn’t work…
int Led[] = {6,9,10};
int State[] ={0,1};
int wait = random(15,100);
for (int x=0; x<500; x++) {
digitalWrite(Led[random(0,2)],State[random(0,1)]);
delay(wait);
}
This will work. You have set the upper bound of random 1 too low, so State[random(0,1)] will always be 0. Also Led[random(0,2)] will never adress Led[2]. The lower bond on the random function is also unecessary. And i believe you wanted the random time included in the loop.
int Led[] = {6,9,10};
int State[] ={0,1};
void setup(){
pinMode(6, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
}//setup()
void loop(){
for (int x=0; x<500; x++) {
digitalWrite(Led[random(3)],State[random(2)]);
delay(random(15,100));
}
}//loop()