My question is simple. Does Arduino set the digitalwrite() the moment it is called or at the end of the while loop. E.G.
int ledPin = 13;
void setup()
{
pinMode(ledPin, OUTPUT);
}
void loop()
{for(int i=0; i<10; i++){
if(i%2==0){
digitalWrite(ledPin, HIGH);
delay(1000);}else{
digitalWrite(ledPin, LOW);
delay(1000); }
}