...
for(i=5; i < 11; i++); // applies power to pins 5 through 10
{
ledPin = i; // increments Pin by plus one (except first time around)
digitalWrite(ledPin, HIGH); // sets ledPin to high
delay(200); // delalys 200 ms
digitalWrite(ledPin, LOW); // sets the ledPin off
}
Would it matter if I used:#define ledPin 5
orint ledPin = 5;
[size=14]Answer:[/size]
Yes it would matter. Because the code
ledPin = i; tries to assign a value to ledPin, this will not be possible when using either
#define or
const datatype.
You are best off using a
byte 
And, you have an error in you for loop syntax:
for(i=5; i < 11; i++); the ; should not be there.
