Hi -
I'm struggling with error:expected unqualified-id before!
Enclosing the file, appreciate help in troubleshooting.
Thanks
Hi -
I'm struggling with error:expected unqualified-id before!
Enclosing the file, appreciate help in troubleshooting.
Thanks
what LCD.h do you use?
LiquidCrystal
NewliquidCrystal
LiquidCrystal I2C
Arduino-LiquidCrystal-I2C-library-master
rockwellramesha:
LiquidCrystal
NewliquidCrystal
LiquidCrystal I2C
Arduino-LiquidCrystal-I2C-library-master
Maybe you need a few more...
Those may be the ones on your computer, but you did NOT answer the question. Only ONE of them will be used. Which one IS used?
The complete error message gives a LOT more information. If you want us to provide more information, you will post the COMPLETE error message.
You have code outside your loop() but not in any function; misplaced }, I think.
Arduino: 1.6.5 (Windows 8), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
fab_insp_router_15_08_2017_rohit_integration:113: error: expected unqualified-id before 'for'
fab_insp_router_15_08_2017_rohit_integration:113: error: 'i' does not name a type
fab_insp_router_15_08_2017_rohit_integration:113: error: 'i' does not name a type
fab_insp_router_15_08_2017_rohit_integration:114: error: expected unqualified-id before 'for'
fab_insp_router_15_08_2017_rohit_integration:114: error: 'i' does not name a type
fab_insp_router_15_08_2017_rohit_integration:114: error: 'i' does not name a type
fab_insp_router_15_08_2017_rohit_integration:115: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:116: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:117: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:118: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:119: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:120: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:121: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:122: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:123: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:124: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:125: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:126: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:127: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:128: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:129: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:130: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:131: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:132: error: expected unqualified-id before 'if'
fab_insp_router_15_08_2017_rohit_integration:134: error: expected declaration before '}' token
Multiple libraries were found for "LiquidCrystal_I2C.h"
Used: C:\Arduino\libraries\LiquidCrystal_I2C-1.1.2
Not used: C:\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master
Not used: C:\Arduino\libraries\NewliquidCrystal
Not used: C:\Arduino\libraries\lcd
expected unqualified-id before 'for'
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Now, all we need is the code you are trying to compile.
made some changes from previous code,enclosed is the code
rockwellramesha:
made some changes from previous code,enclosed is the code
So, new code but same errors? Why not stop digging now that your hole is deep enough?
Arduino: 1.6.5 (Windows 8), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
fab_insp_router_15_08_2017_rohit_integration.ino: In function 'void statusupdate_loop()':
fab_insp_router_15_08_2017_rohit_integration:114: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:117: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:119: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:120: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:121: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:122: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:123: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:124: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:125: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:126: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:127: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:128: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:129: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:130: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:131: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:132: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:133: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:134: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:135: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:136: error: 'flt_cln' cannot be used as a function
fab_insp_router_15_08_2017_rohit_integration:140: error: a function-definition is not allowed here before '{' token
fab_insp_router_15_08_2017_rohit_integration:453: error: expected '}' at end of input
Multiple libraries were found for "LiquidCrystal_I2C.h"
Used: C:\Arduino\libraries\LiquidCrystal_I2C-1.1.2
Not used: C:\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master
Not used: C:\Arduino\libraries\NewliquidCrystal
Not used: C:\Arduino\libraries\lcd
'flt_cln' cannot be used as a function
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
int delay0 = (delay, 20);
Why are you abusing the comma operator this way? Just what do you think this is supposed to do?
const byte ROW = 1; //four rows
const byte COL = 5; //four columns
Yeah, right.
void statusupdate_loop()
{int start = 33, flt_cln=0,halt = 35, record = 37, buzzer = 41;
NOTHING follows the { on the same line.
{int i;
{{for (i = 3; i < 11; i++) if (digitalRead(i) == HIGH) flt_cln(i);}
{for (i = 14; i < 20; i++) if (digitalRead(i) == HIGH) flt_cln(i);}
{Random} {curly} {braces} {are} {NOT} {how} {to} {write} {code}.
Why ARE you trying to call an int as though it was a function?
If you learn to indent properly (use tools -> auto format in the IDE), it's clear that you have a mismatch between the number of { and the number of }
void statusupdate_loop()
{int start = 33, flt_cln=0,halt = 35, record = 37, buzzer = 41;
pinMode(buzzer, OUTPUT);
pinMode(halt, OUTPUT);
digitalWrite(buzzer, LOW);//buzzer off
digitalWrite(halt, LOW);//machine on
pinMode(start, INPUT);
pinMode(halt, INPUT);
pinMode(record, INPUT);
{int i;
{{for (i = 3; i < 11; i++) if (digitalRead(i) == HIGH) flt_cln(i);}
{for (i = 14; i < 20; i++) if (digitalRead(i) == HIGH) flt_cln(i);}
if (digitalRead(22) == HIGH) flt_cln(22);
if (digitalRead(23) == HIGH) flt_cln(23);
if (digitalRead(A0) == HIGH) flt_cln(A0);
if (digitalRead(A1) == HIGH) flt_cln(A1);
if (digitalRead(A2) == HIGH) flt_cln(A2);
if (digitalRead(A3) == HIGH) flt_cln(A3);
if (digitalRead(A4) == HIGH) flt_cln(A4);
if (digitalRead(A5) == HIGH) flt_cln(A5);
if (digitalRead(A6) == HIGH) flt_cln(A6);
if (digitalRead(A7) == HIGH) flt_cln(A7);
if (digitalRead(A8) == HIGH) flt_cln(A8);
if (digitalRead(A9) == HIGH) flt_cln(A9);
if (digitalRead(A10) == HIGH) flt_cln(A10);
if (digitalRead(A11) == HIGH) flt_cln(A11);
if (digitalRead(A12) == HIGH) flt_cln(A12);
if (digitalRead(A13) == HIGH) flt_cln(A13);
if (digitalRead(A14) == HIGH) flt_cln(A14);
if (digitalRead(A15) == HIGH) flt_cln(A15);
}}
void menu(int i) {
After auto format
void statusupdate_loop()
{ int start = 33, flt_cln = 0, halt = 35, record = 37, buzzer = 41;
pinMode(buzzer, OUTPUT);
pinMode(halt, OUTPUT);
digitalWrite(buzzer, LOW);//buzzer off
digitalWrite(halt, LOW);//machine on
pinMode(start, INPUT);
pinMode(halt, INPUT);
pinMode(record, INPUT);
{ int i;
{{
for (i = 3; i < 11; i++) if (digitalRead(i) == HIGH) flt_cln(i);
}
{
for (i = 14; i < 20; i++) if (digitalRead(i) == HIGH) flt_cln(i);
}
if (digitalRead(22) == HIGH) flt_cln(22);
if (digitalRead(23) == HIGH) flt_cln(23);
if (digitalRead(A0) == HIGH) flt_cln(A0);
if (digitalRead(A1) == HIGH) flt_cln(A1);
if (digitalRead(A2) == HIGH) flt_cln(A2);
if (digitalRead(A3) == HIGH) flt_cln(A3);
if (digitalRead(A4) == HIGH) flt_cln(A4);
if (digitalRead(A5) == HIGH) flt_cln(A5);
if (digitalRead(A6) == HIGH) flt_cln(A6);
if (digitalRead(A7) == HIGH) flt_cln(A7);
if (digitalRead(A8) == HIGH) flt_cln(A8);
if (digitalRead(A9) == HIGH) flt_cln(A9);
if (digitalRead(A10) == HIGH) flt_cln(A10);
if (digitalRead(A11) == HIGH) flt_cln(A11);
if (digitalRead(A12) == HIGH) flt_cln(A12);
if (digitalRead(A13) == HIGH) flt_cln(A13);
if (digitalRead(A14) == HIGH) flt_cln(A14);
if (digitalRead(A15) == HIGH) flt_cln(A15);
}
}
void menu(int i) {
void menu(int i) should start at the beginning of the line after an auto format; this clearly indicates a mismatch between { and }
Why do you have a { in this line?
{ int i;
If you remove it, you will have one problem less.
Why the extra { and } if they serve no purpose?
{{
for (i = 3; i < 11; i++) if (digitalRead(i) == HIGH) flt_cln(i);
}
{
for (i = 14; i < 20; i++) if (digitalRead(i) == HIGH) flt_cln(i);
}
...
...
}
The below looks a lot better
void statusupdate_loop()
{
int start = 33, flt_cln = 0, halt = 35, record = 37, buzzer = 41;
pinMode(buzzer, OUTPUT);
pinMode(halt, OUTPUT);
digitalWrite(buzzer, LOW);//buzzer off
digitalWrite(halt, LOW);//machine on
pinMode(start, INPUT);
pinMode(halt, INPUT);
pinMode(record, INPUT);
int i;
for (i = 3; i < 11; i++) if (digitalRead(i) == HIGH) flt_cln(i);
for (i = 14; i < 20; i++) if (digitalRead(i) == HIGH) flt_cln(i);
}
Also I personally would place the ifs on their own line. If it's what you need is something else.
After that you still have all kinds of stuff outside functions
logged:
if (t == 1) {
...
...
That if should be inside a function and hence, after an auto format, never be at the beginning of a line.
Thanks PaulS - appreciate your support!
Thanks a lot Sterretje - appreciate your kind support
Sterretje - you are a great tutor!