Hi, I'm new to ardu and in general to the micro controllers.I've purchased Arduino Mega 2560and I've started to play with the "Blink"I've encountered a small problem, not sure if it is my approach to the programming,or what....?

for(i=5;i<8;i++){ led=i; digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second if (i==8){ i=5; } } }

what i wanted to get is 3 LED's connected to the pins 5,6,7 to light up, one after another.And LED on pin 5 works ok, but 6 and 7 are very, very, dim. they are tested and working the same way if i'll swap their places.

Your code only works if the LEDs are attached to sequentially numbered pins, which lacks flexibility. Here I've held the pin numbers in an array and then I can just process the array. With this approach the LEDs do not have to be on sequential pins and another LED could be added easily by adding it's pin number to the ledPin array and changing MAX_PINS to suit.