Error: expected ';' before 'digitalWrite'

I mega beginner I don't know what the error code: error: expected ';' before 'digitalWrite' means with the following code:

void setup() {

pinMode(13,OUTPUT);
pinMode(12,OUTPUT);
pinMode(11,OUTPUT);
pinMode(10,OUTPUT);
pinMode(9,OUTPUT);
pinMode(8,OUTPUT);
pinMode(7,OUTPUT);
pinMode(6,OUTPUT);
}

void loop() {

digitalWrite(13,HIGH);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,LOW);
digitalWrite(9,LOW);
digitalWrite(8,LOW);
digitalWrite(7,LOW);
digitalWrite(6,LOW);
delay(100);
digitalWrite(13,LOW);
digitalWrite(12,HIGH);
digitalWrite(11,LOW);
digitalWrite(10,LOW);
digitalWrite(9,LOW);
digitalWrite(8,LOW);
digitalWrite(7,LOW);
digitalWrite(6,LOW);
delay(100);
digitalWrite(13,LOW);
digitalWrite(12,LOW);
digitalWrite(11,HIGH);
digitalWrite(10,LOW);
digitalWrite(9,LOW);
digitalWrite(8,LOW);
digitalWrite(7,LOW);
digitalWrite(6,LOW);
delay(100);
digitalWrite(13,LOW);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,HIGH);
digitalWrite(9,LOW);
digitalWrite(8,LOW);
digitalWrite(7,LOW);
digitalWrite(6,LOW);
delay(100);
digitalWrite(13,LOW);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,LOW);
digitalWrite(9,HIGH);
digitalWrite(8,LOW);
digitalWrite(7,LOW);
digitalWrite(6,LOW);
delay(100);
digitalWrite(13,LOW);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,LOW);
digitalWrite(9,LOW);
digitalWrite(8,HIGH);
digitalWrite(7,LOW);
digitalWrite(6,LOW);
delay(100)
digitalWrite(13,LOW);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,LOW);
digitalWrite(9,LOW);
digitalWrite(8,LOW);
digitalWrite(7,HIGH);
digitalWrite(6,LOW);
delay(100);
digitalWrite(13,LOW);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,LOW);
digitalWrite(9,LOW);
digitalWrite(8,LOW);
digitalWrite(7,LOW);
digitalWrite(6,HIGH);
delay(100);
}

Welcome to the forum

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

    delay(100)
      digitalWrite(13, LOW);

Missing semicolon on the delay() function

The error message

69:1: error: expected ';' before 'digitalWrite'

tells you to look at line 69 of the sketch and the missing semicolon is on the previous line


digitalWrite(6,LOW);
delay(100)
digitalWrite(13,LOW);

You are missing a ; after delay(100)

Thank you Thank you with the <code wanted to do it but I was afraid that it would be formatted

This is a really easy error to solve. It tells you exactly what the problem is. It tells you what line the error is on, so look at that line. It tells you that it expected a semicolon before digitalWrite, so lok before the digitalWrite (that would be the line before) and see if there is a semicolon missing.

The best thing to do when posting code is to use Edit/Auto Format in the IDE to tidy up the layout then use Edit/Copy for Forum to copy it and automatically add code tags ready to paste in a forum reply

Unrelated to your problem but if you learn about 'functions', 'arrays' and 'for loops' you could drastically simplify your code. I remember being blown away when I first combined these things together.

Boy your good. I'll bet you could pass the test where you have to count the "of" in a paragraph :grinning:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.