Go Down

Topic: Expected unqualified-id? (Read 640 times) previous topic - next topic

adam1997gipe

Does it really matter? I had both of rpm and max rpm on the same line, but someone suggested I try moving it. I didn't really plan on measuring stuff that fast, I just saw a few different codes online that used that command

michinyon

To call functions on an object called lcd,   you first have to create and initialise that object.

To do that,  you have to include a declaration of the instance of the LiquidCrystal class,  which includes a constructor for the object.

You will need a line near the top of your program which will look something like this

Code: [Select]


LiquidCrystal lcd( 4,5,6,7,8,9 );




This code does two things.  It creates an instance of the LiquidCrystal class that you are going to call "lcd".

It will call the constructor method of the LiquidCrystal class,  to initialize the lcd object.  The numbers in the parentheses are the arduino pin numbers for the 6 control lines for the lcd device.

A previous reply in this thread suggested

Code: [Select]

LiquidCrystal( 3,4,5,6,7,8 );   // wrong code, don't use it


That looks like a call to the constructor method for the LiquidCrystal class,   but in this context,  it is wrong.  What's the variable name for the class instance object ?  It isn't there....




Go Up