expected ',' or ';' before 'int' error help please!

I need help with this code!

int del = 300
int del2 = 900

void setup() {

pinMode (13, OUTPUT);
}
void loop() {

digitalWrite (LED_BUILTIN, HIGH);
delay (del);
digitalWrite (LED_BUILTIN, LOW);
delay (del);
digitalWrite (LED_BUILTIN, HIGH);
delay (del2);
digitalWrite (LED_BUILTIN, LOW);
delay (del2);
}

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:
[code]`` [color=blue]// your code is here[/color] ``[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read. If you're using the Arduino Web Editor you will not have access to this useful tool. I recommend you to use the standard IDE instead.

Please remove unnecessary blank lines from your code before posting to the forum. One or two to separate code into logical sections is fine but large spaces for no reason just make for more scrolling when we're trying to read your code.

When you encounter an error you'll see a button on the right side of the orange bar "Copy error messages". Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

Take a look at the error. It's telling you that a , or ; was expected somewhere before the highlighted line. Now look at the code that comes before that line. Do you see anything missing?

Hi,
Welcome to the forum.

your int statements at the beginning of your code need to each end in ;

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom.. :slight_smile:

need a ; after each int line.

int del = 300;
int del2 = 900;

Toasty

You need to add semi colons after each of your global declarations, so:

int del = 300;
int del2 = 900;

is correct.

Also, and not being picky, as you aren't going to be using negative signed numbers, why not declare as:

word del = 300;
word del2 = 900;

Just a thought.

Azerla:
Also, and not being picky, as you aren't going to be using negative signed numbers, why not declare as:

word del = 300;
word del2 = 900;

This is the first time I have seen the word type suggested for an Arduino program. char, byte, int and long are the usual types

...R

Azerla:
and not being picky, as you aren't going to be using negative signed numbers, why not declare as:

word del = 300;
word del2 = 900;

If you need a delay of 30k odd milliseconds, let alone 60, you very likely have bigger problems with your code than choosing a variable type.

why not declare as:

word del = 300;
word del2 = 900;

Because the rest of us, who hate Microsoft's useless typedef statements, will ridicule you mercilessly.

First time I've even noticed that the "word" type exists in this environment. Stupid name for an unsigned int. Who thinks it makes sense putting numbers into a word?

Steve

Who thinks it makes sense putting numbers into a word?

The same people that use

   int incomingByte;

I think the person who wrote this Serial.read() - Arduino Reference has a good reason for using int.