Code not compiling to arduino UNO

Hi folks,

Im having a bit of trouble trying to get this For Loop to compile

const int ledPin = 13;
int myCounter = 0;

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT); 



for (int j=1; j<=10; j=j+1) {   
  int delayPeriod = 1000;
  digitalWrite(ledPin, HIGH);
  delay(delayPeriod); 
  digitalWrite(ledPin, LOW);
  delay(delayPeriod); 
  
}
}

Ive been trying to get this going for a couple of hours now and haven't got any further, im unsure of what I am missing to get this to work.

It compiles if I put a void Loop in front of the for loop but the obviously it just loops forever

the error message im getting is:

error compiling for arduino uno

the error message im getting is:

error compiling for arduino uno

I bet that's not all is says.

Something about a missing loop function maybe?

assuming you want your 'for' loop to run only once, you still need add to add the 'loop' routine like this:

const int ledPin = 13;
int myCounter = 0;

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);



  for (int j = 1; j <= 10; j = j + 1) {
    int delayPeriod = 1000;
    digitalWrite(ledPin, HIGH);
    delay(delayPeriod);
    digitalWrite(ledPin, LOW);
    delay(delayPeriod);

  }
}

void loop() {
  //nothing here
}

LEGIT JUST FIXED IT!

I was just dicking around and typed the void loop after the set up and she works!!

sorry to bother you guys!!! But thank you for the quick replies!!!