Error in code that didn't previously occur

Hi,

Having an issue with my code. I’m getting a bunch of these errors for all of my functions: error: “expected constructor, destructor, or type conversion before ‘;’ token”.

I never used to get these errors when uploading this sketch (on a previous Arduino version), so I don’t know what’s causing it. The code looks fine to me, but there must be something wrong.

Can anyone help?

Code.ino (51.5 KB)

You Will likely get more help if you post your code not as an attachment but directly in the post using code </> tag so that the code appears something like this

//code here to review

On your new Arduino installation, you’ve loaded all the required libraries, Adafruit_NeoPixel.h etc. ?

I can't insert the code, the post exceeds 9000 characters.

Yep I've got the library loaded.

Ok cant read from my smartphone. Will have a look another time

Can you post the output of the compiler error. Very often it tells a lot right there in the very first lines

/////... LOOP \\\\\

Putting a line continuation character at the end of a comment is a terrible choice.

J-M-L:
Ok cant read from my smartphone. Will have a look another time

Can you post the output of the compiler error. Very often it tells a lot right there in the very first lines

Is this what you mean? It’s the output of the error:

Code:80: error: expected constructor, destructor, or type conversion before ‘;’ token
Code:81: error: expected constructor, destructor, or type conversion before ‘;’ token
Code:82: error: expected constructor, destructor, or type conversion before ‘;’ token
Code:83: error: expected constructor, destructor, or type conversion before ‘;’ token
Code:84: error: expected constructor, destructor, or type conversion before ‘;’ token
Code:85: error: expected constructor, destructor, or type conversion before ‘;’ token
Code:86: error: expected constructor, destructor, or type conversion before ‘;’ token
Code:87: error: expected constructor, destructor, or type conversion before ‘;’ token
Code:88: error: expected constructor, destructor, or type conversion before ‘;’ token
Code:89: error: expected constructor, destructor, or type conversion before ‘;’ token
Code:90: error: expected constructor, destructor, or type conversion before ‘;’ token
Code:91: error: expected declaration before ‘}’ token

On each of those lines is a new function. I’ll paste the loop block below:

void loop() {
mainFunctions();
countTime();
leftPress();
rightPress();
displayHours();
redIntensity();
violetIntensity();
ledDuration();
settings();
buzzButtons();
ledLights();
}

Didn’t you read Coding Badly’s reply?

I found the same thing. You have a comment line immediately before “void loop() {” with forward backslashes on the end. As a result, this is treated as a comment:- “void loop() {”

If you add a blank line before the beginning of your ‘loop()’ function, the code compiles fine.
As Coding Badly said, it’s not a good idea to put line continuation characters at the end of comment lines for no good reason.

(I was originally in the process of posting when Coding Badly beat me to the punch, so I aborted. :slight_smile: )

Hi, As pointed out in post#5

////////////////////////////////////////////////////////////////////////////////// SETUP \\\\\

should be

// SETUP

If you look ALL the error lines noted are after your funny comment structure.

Tom... :)

[quote author=Coding Badly link=msg=2896820 date=1472200051]

/////... LOOP \\\\\

Putting a line continuation character at the end of a comment is a terrible choice.

[/quote]

Thanks, that fixed it. I thought you were just posting a tip for having cleaner code.

"Terrible choice" is a good indication that the post was more than a tip. ;)

You are welcome.