Arduino Digitalwrite for while loop set 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&lt;10; i++){
if(i%2==0){
  digitalWrite(ledPin, HIGH);   
  delay(1000);}else{                  
  digitalWrite(ledPin, LOW);    
  delay(1000);      }           
}
A key point of the Arduino 'language' is every statement is completed before the next one can begin. 

A simple statement has a ';' at the end of it.
Or followed by ')' instead of ';' in for (...; ...; statement) loop.

So digitalWrite() will set the pin, HIGH or LOW, before it completes and allows the next statement, delay(...) to begin.

Side note:
Actually digitalWrite() takes a small amount of time to do its work, so it is not exactly 'the moment' it is called. digitalWrite() is pretty quick, a few millionths of a second, which is usually near enough to be practically 'the moment' for most applications.