Trouble using LCD (HD44780) and new Arduino Mega

I have been trying to get anything to show up on my LCD using the Mega board and the LiquidCrystal library. I have tried both the original 0015 build as well as an alternate LiquidCrystal.cpp from Donald Weiman I pulled from this forum. I get nothing on the display. Can anyone perhaps point me in the right direction? Thanks.

Here is the code:

#include <LiquidCrystal.h>

// LiquidCrystal display with:
// rs on pin 12
// rw on pin 11
// enable on pin 10
// d4, d5, d6, d7 on pins 5, 4, 3, 2
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

void setup()
  // Print a message to the LCD.
  lcd.print("hello, world!");

void loop()

I have used both these pins provided in the code as well as the Digital pins. In fact I’ve tried a number of pin configurations. Nothing worked. I have tested the LCD with an Atmel 168 and that worked just fine. Power is being provided from an external source not from the mega board.

Has anyone getten an LCD to work with the Mega board? If so, could you please advise as to which pins you used? Thank you.


I seemed to have solved my issue. I did not realize that there is a Verify/Compile command in the Arduino menu on my computer. I selected that and my code worked.