Pass the LCD object to a library

Hi all,

I've a LCD menu system which works quite well for my purposes. Now I'm trying to create a library to move all the code possible from the sketch. To do that I would need the library to print on the LCD screen. Right now on the top of my sketch I've created an instace of the LiquidCrystal library:

LiquidCrystal lcd(2,3,4,5,6,7);

How can I pass the lcd object to the library?

Thanks in advance,

How can I pass the lcd object to the library?

You can't.

You can pass it to a method that belongs to a class that is in a library or to a function that is in a library, but making the function or method accept an argument of type reference to LiquidCrystal (LiquidCrystal &).

PaulS:

How can I pass the lcd object to the library?

You can't.

You can pass it to a method that belongs to a class that is in a library or to a function that is in a library, but making the function or method accept an argument of type reference to LiquidCrystal (LiquidCrystal &).

ah, ok... I will try to assimilate that. Thanks

EDIT: I think this is what I actually wanted to ask. How could I do that? The target is to have the library write directly on the LCD.

Check this thread.
http://forum.arduino.cc/index.php?topic=185613.0