Library pin numbers

I have an Arduino mega controlling a solar panel to track the sun on my boat. It uses a polulu motor driver and there are many, many digital inputs to such as limit switches etc. It all works well.
I now want to add an LCD display. The sketch I have seen in an Arduino manual calls for me to include a library and then creates an object specifying pin numbers. All these pin numbers are already in use by my own sketch so I'll have to assign my own pins but how do I get the library to recognise my pin numbers?
Bob Rice

The sketch I have seen in an Arduino manual calls for me to include a library and then
creates an object specifying pin numbers.

You specify the pin numbers when you create the object. See:

Is this LCD display a shield, setting on top of the arduino board, or wired with jumper wires?
What is the URL for this LCD display?

You specify the pin numbers when you create the object. See:

LiquidCrystal - Arduino Reference

The real question is why this information is so hard to find. It's obscurity is why most beginners, who tend to use the tutorials, don't ever get to see it.

Start here: http://arduino.cc/en/Tutorial/LiquidCrystal
Scroll down to the bottom
Use the Liquid Crystal Library link to get here: http://arduino.cc/en/Reference/LiquidCrystal
Use the LiquidCrystal() link to get here: http://arduino.cc/en/Reference/LiquidCrystalConstructor
And there it is under 'Syntax'

It is also beyond my comprehension why they left out a simple comment in the LiquidCrystal tutorial which may very well have been sufficient to explain the concept.

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

Don

Or even better use const variables to define the pins:

const int LCD_RS = 12;  // Arduino pin connected to LCD RS pin
const int LCD_EN = 11;  // Arduino pin connected to LCD EN pin
const int LCD_D4 = 5;   // Arduino pin connected to LCD D4 pin
const int LCD_D5 = 4;   // Arduino pin connected to LCD D4 pin
const int LCD_D6 = 3;   // Arduino pin connected to LCD D6 pin
const int LCD_D7 = 2;   // Arduino pin connected to LCD D7 pin


// initialize the library with the Arduino pin numbers of the LCD interface pins
LiquidCrystal lcd(LCD_RS, LCD_E, LCD_D4, LCD_D5, LCD_D6, LCD_D7);

Which makes it pretty obvious and much harder to accidentally screw up
since you don't ever mess with the constructor itself.

--- bill