Hi Geoff,
I thought the problem was solved, but it isn't...
But I think, I'v found the problem.
It's the Random function, and probably Randomseed (analogRead, 0);
0 is also used as D0 out. So I have to make a separate random generator.
Still have to find out, but there is a lot on the web about that.
If I skip the random function and just use 'delay' there is no problem.
I also added something:
The last led fading out, instead of just turning of.
I just fooled arround with the code and it doesn't make sence to me why its working, but is IS working.
Fist of all, add 'void fade' :
void fade (int thisLED){
digitalWrite(charliePin[LED[10][1]], LOW);
for(int fadeVal = 0; fadeVal< 255; fadeVal++) {
analogWrite (charliePin [LED[19][0]],fadeVal);
delay (2);
}
}
Then add this line here:
current++;
if(current==23) { // start over
fade(current-1); // <----- ADD THIS LINE
current = 0;
charlieON(-1); // all off
//delay(random(3000)); // after a short pause (commented this line temporary and used
delay(2000); // delay instead
}
Greets, Davy