I don't understand my first simple programme error message

I keep getting an error message that have tried to correct be retyping or copy & pasting examples but I still get an error message that I don't understand
"expected ';' before the '{' token. See attached

keithatsibford:
I keep getting an error message that have tried to correct be retyping or copy & pasting examples but I still get an error message that I don't understand
"expected ';' before the '{' token. See attached

your zeros look like O's.

delay(1000);  // note slash

instead of

delay(1OOO);  // note lack of slash

make sure that the zeros are indeed zeros.

Sometimes the error message is a bit cryptic. Looks to me like you have a . not a , in this line:

digitalWrite(ledPin. HIGH);

It should be:

digitalWrite(ledPin, HIGH);

And do change the . to a ,
in the line

digitalWrite(ledPin. HIGH);

:wink:

Thanks everyone. I've checked the zeros - OK, and corrected the point to a coma. Still get the same error message!

Ok well post the new code. Don't attach a pic, just copy/paste the code into your reply. Then select the code and tag it by hitting the </> icon so it looks....

like this

Please post your code as well as complete error message using code tags. [code]your code or error message here[/code] results in

your code or error message here

The code in images is impossible to copy.

Note:
The output window contains more than the short error message that you posted; please post the complete error message.

Please post the actual code, not a .jpg

Thanks again for your input. I'll have to look up how to post the code. Bear with me. It's my first attempt.

• Click Reply

• Click the Code Tags button...

CodeTags.png

• Paste your code

• Click Post

• Optionally use Auto Format in the Arduino IDE before pasting your code.

/*
 * Keith's 1st programme
 */

int ledPin = 13;

void setup()
{
  pinMode(ledPin, OUTPUT);
}

void loop()
{
  digitalWrite(ledPin, HIGH);            
  delay(1000); 
  digitalWrite(ledPin, LOW);
  delay{1000);
}

There is a problem with the last line in the loop() function
delay{1000);

should be delay(1000);

i.e. the bracket should be round "(" not a brace "{"

Corrected that, but I still have the same error message that sticks at the first delay(1000); line.

(deleted)

keithatsibford:
Corrected that, but I still have the same error message that sticks at the first delay(1000); line.

Please remember that unless you show us your code, we can't see it.
We can tell you to make changes, but unless we can see that you've made the changes, we can't be sure that what you're telling us you think you see is exactly what the compiler can see.

/*
 * Keith's 1st programme
 */

int ledPin = 13;

void setup()
{
  pinMode(ledPin, OUTPUT);
}

void loop()
{
  digitalWrite(ledPin, HIGH);            
  delay(1000); 
  digitalWrite(ledPin, LOW);
  delay(1000);
}

(deleted)

Thanks everyone - particularly spycather2k - worked at treat. On to my next project now, programming servos