rov2.ino: In function 'void setup()':
rov2:866: error: a function-definition is not allowed here before '{' token
rov2:1286: error: expected `}' at end of input
rov2.ino: In function 'void setup()':
rov2:867: error: expected initializer before 'if'
rov2:875: error: 'else' without a previous 'if'
rov2:885: error: a function-definition is not allowed here before '{' token
rov2:1286: error: expected `}' at end of input
ok im obviously missing something here and ive got no idea what as for as i can tell that is the right lay out for that code as ive got no errors else were that ive used the same lay out for an if statement... and the code is way to long to post on the forums....
Hi, have you done a "TOOLS" then "Auto Format" tags at the top of the IDE.
I have found that it will apart from align your code indents, it will also check for correct { and }.
TomGeorge:
Hi, have you done a "TOOLS" then "Auto Format" tags at the top of the IDE.
I have found that it will apart from align your code indents, it will also check for correct { and }.
Tom.....
What IDE, in 1.5.6 I can't get any errors about missing '{' or '}'.
A worst case scenario even works: "void setup(){{{{{{{{void loop(){int a;" will happily auto format to:
"void setup() { {{{{{{{ void loop() { int a;"
Not even a new line gets inserted. Maybe some features of Auto format were dropped after 1.0.5
Hi, IDE 1.5 tells me that your example has tooo many left {.
IDE 1.5.5 does what 1.5.6 does, no errors.
A feature that will be missed, so if I do my sketch in 1.5.6, I just reload it into 1.5 and do a format.
I had a suspicion that is what you meant. It is wrong, as is
else if (output_format == OUTPUT__FORMAT_TEXT);
Look at http://arduino.cc/en/Reference/If carefully. Do you see any semi-colons at the end of the lines except where the test is immediately followed by the one line of code to be executed if the test is true ?
Including the semi-colon effectively stops the test from happening and causes the following code block to be always executed.