Hi people,
I am new to electronics and my knowledge base is relatively limited so I am not sure this is proper place to ask my question, if so I apologize in advance.
I recently built a simple circuit using arrays and for loops and I came across this problem which has me baffled.
I am using a for loop to set the pins for the array as outputs and other for loop to simply turn on and then off a series of leds.
The array runs for a period of time fine, in my case roughly 13 times, before all the leds remain on for a pro-long period of time(roughly 8 seconds then turns off, wait roughly a second of so then turns all the less on and the hesitation starts over eventually leaving all the less lite.
I have no idea why this is happening since the code seems simple enough, can anyone tell me why this is happening?
Assistance is greatly appreciated.
my code:
int ledArray[] = {2,3,4,5,6,7}; // pins in the array
int Time = 75; // sets the on and off time
void setup() {
// initialize digital pins 2 through 7 as an output
for(int i; i <6; i++)
{
pinMode(ledArray*, OUTPUT);*
- }*
} - // turns on leds in sequence*
- void loop()*
{ - for (int i=0; i<=6; i++) {*
_ digitalWrite(ledArray*, HIGH);_
_ delay(Time);_
_ }_
_ for (int i=6; i>=0; i--) // turns off the leds in sequence*_
* {*
_ digitalWrite(ledArray*, LOW);
delay(Time);
}
delay(1000);
}*_