0

LCD modules
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

LCD modules

by niksun on Sun Feb 08, 2009 11:59 am

Anyone ever used this LCD module with the Arduino before? According to the datasheet, it uses the HD44780 chipset which is perfectly compatible with Arduino's LiquidCrystal library. For some reason, I'm having problems getting it to work. Here's my hookup:

pin 1: GND
pin 2: +5V
pin 3: unconnected (although I've also tried connecting it to GND; what does V_L mean anyway?)
pin 4: pin 10 on the Arduino
pin 5: pin 11 on the Arduino
pin 6: pin 12 on the Arduino
pins 7-10: unconnected
pin 11: pin d5 on the Arduino
pin 12: pin d4 on the Arduino
pin 13: pin d3 on the Arduino
pin 14: pin d2 on the Arduino
pins 15-16: unconnected (don't need the LED backlight for now)

Simple sample :lol: source:

Code: Select all | TOGGLE FULL SIZE
#include <LiquidCrystal.h>

// RS, R/W, E, D4, D5, D6, D7
LiquidCrystal lcd(10, 11, 12, 5, 4, 3, 2);

void setup()
{
  Serial.begin(9600);
  Serial.println("Type something, fool!");
  lcd.print("Hello World!");
}

void loop()
{
  char c;
 
  if (Serial.available())
  {
    c = Serial.read();
    Serial.print("I received: ");
    if (c == '\n' || c == '\r')
      Serial.println("\\n");
     else if (c == '\t')
       Serial.println("\\t");
     else if (c == ' ')
       Serial.println("{space}");
     else
     {
      Serial.println(c);
      lcd.write(c);
     }
  }
}


On another note, the LCD module comes with a nice flat ribbon cable. Anyone know which 16-pin connector I can find to put on the bare end to make interfacing with the Arduino a "cinch"?
Niksun

If you thought before that science was certain--well, that is just an error on your part. -- Richard Feynman
niksun
 
Posts: 202
Joined: Sun Jul 27, 2008 9:59 pm

Re: LCD modules

by mtbf0 on Sun Feb 08, 2009 10:25 pm

you don't say what's wrong, but since you've got no contrast control i'd guess you don't see anything. put a 10k pot on the contrast pin, (3), and adjust it 'til you see you see faint rectangles in the character positions. when you start getting characters on it fine tune the contrast.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

Re: LCD modules

by niksun on Sun Feb 08, 2009 10:27 pm

Connecting the contrast pin to ground sets the most contrast: I see dark rectangles.
Niksun

If you thought before that science was certain--well, that is just an error on your part. -- Richard Feynman
niksun
 
Posts: 202
Joined: Sun Jul 27, 2008 9:59 pm

Re: LCD modules

by mtbf0 on Mon Feb 09, 2009 5:58 am

if you want to see dark characters in those dark squares, adjust the contrast. it's not an on and off thing. use a pot. 10k gives good resolution.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

Please be positive and constructive with your questions and comments.