Got it sorted out. With this particular LCD, I connected its pins (as seen on page 4 of their data sheet) to the pins on my Arduino, as follows:
LCD Pin 01: +5V (LED+)
LCD Pin 02: GND (LED-)
LCD Pin 03: N/C (VSS)
LCD Pin 04: +5V (VDD)
LCD Pin 05: GND (V0)
LCD Pin 06: Pin 9 (RS)
LCD Pin 07: GND (RW) ... tied to GND because I don't want to read from the screen
LCD Pin 08: Pin 4 (E) .. E = Enable
LCD Pin 09: N/C (DB0)
LCD Pin 10: N/C (DB1)
LCD Pin 11: N/C (DB2)
LCD Pin 12: N/C (DB3)
LCD Pin 13: Pin 5 (DB4)
LCD Pin 14: Pin 6 (DB5)
LCD Pin 15: Pin 7 (DB6)
LCD Pin 16: Pin 8 (DB7)
The easiest way to see how you went with it is to open the 'HelloWorld' LiquidCrystal example. I made the following changes:
// LiquidCrystal display with:
// rs on pin 9
// rw is going to ground, so I'll put -1 so it doesn't try to use a real pin
// enable on pin 5
// d0, d1, d2, d3 on pins 5, 6, 7, 8
LiquidCrystal lcd(9, -1, 4, 5, 6, 7, 8);
The LiquidCrystal library is good but lacking some functionality, so I downloaded and extracted the LCD4Bit library (Arduino Playground - LCD4BitLibrary), then deleted the 'LCD4Bit.o' file from my '%arduino_install_dir%\hardware\libraries\LCD4Bit' directory. We need to delete this file because it'll be recompiled when we Upload to the Arduino...after we make the following edits to LCD4Bit.cpp:
// --------- PINS -------------------------------------
//is the RW pin of the LCD under our control? If we're only ever going to write to the LCD, we can use one less microcontroller pin, and just tie the LCD pin to the necessary signal, high or low.
//this stops us sending signals to the RW pin if it isn't being used.
int USING_RW = false;
//RS, RW and Enable can be set to whatever you like
int RS = 9;
int RW = 10; // Doesn't matter what's here because we're not USING_RW
int Enable = 4;
//DB should be an unseparated group of pins - because of lazy coding in pushNibble()
int DB[] = {5, 6, 7, 8}; //wire these to DB4~7 on LCD.
And then in the LCD4BitExample sketch, all we need to change are this parameter to tell it we have 2 lines:
//create object to control an LCD.
//number of lines in display=2
LCD4Bit lcd = LCD4Bit(2);
And then lower down in the void loop(), we uncomment this section:
lcd.cursorTo(2, 0); //line=2, x=0.
lcd.printIn("Score: 6/7");
delay(1000);
And it's all hunky dory! Thanks to all who helped.
Problem solved. dusting off my hands
Cheers,
Scott