LCD4bit Library (liquid crystal works.)

So i bought http://www.sparkfun.com/datasheets/LCD/GDM2004D.pdf

pretty easy to setup, and i wired it to work with this exact program

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

void setup()
{
  lcd.print("hello, world!");
}

void loop() {}

it works, but when i do the example using lcd4bit... nogo (my lcd screen shows the test pattern when power is applied)

n your circuit (1): You must tie the LCD's R/W pin to ground. (This frees another arduino pin for you). See this forum post for more troubleshooting.

In your circuit (2): remove the 4 lower bits of the data bus between the arduino and the LCD. We only use DB4~7.

did step 1, already did step2

changed to appropriate pins on the library:

//RS, RW and Enable can be set to whatever you like
int RS = 12;
int RW = 11;
int Enable = 10;
//DB should be an unseparated group of pins  - because of lazy coding in pushNibble()
int DB[] = {5, 4, 3, 2};  //wire these to DB4~7 on LCD.

//--------------------------------------------------------

//how many lines has the LCD? (don't change here - specify on calling constructor)
int g_num_lines = 4;

any ideas?

Did you do this part, as per my recent thread?

I downloaded the LCD4Bit library (http://www.arduino.cc/playground/Code/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:

And have you got this set to false:

// --------- 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;

good point on the file deletion. Yeah i made the changes and tried a few variations. The best i got with the lcd4bit library was a cursor that blinked around the screen (when it was supposed to be writing out fruits... etc)

using liquidcrystal:
I did notice that when i have a long printout such as
lcd.print("11111111111111111111222222222222222222223333333333333333333344444444444444444444");
line1 = 1
line2 = 3
line3 = 2
line4 = 4 (all 20chars long obviously)

Interesting. Unfortunately I don't know enough to be able to offer much help. Double triple check your connections?

yeah i checked them prob 10 times lol. umm yea i just will format coding to work with liquidcrystal, but this is odd. Also println on lcd doesn't work.

i think that this lcd is a little different than standards

I can't remember which LCD you said you've got. Are you sure it's HD44780 compliant? I suppose it since the liquidcrystal stuff works, well some of it anyway.

sparkfun: "Utilizes the extremely common HD44780 parallel interface"

datasheet "Built-in controller (S6A0069 or equivalent)"

datasheet says nothing about HD44780

so i'm guessing there are some slight differences.

Hey moop,

When you compile the LCD4Bit library, you don't happen to get this error, do you?

LCD4Bit.cpp: In member function 'void LCD4Bit::init()':
LCD4Bit.cpp:174: warning: suggest parentheses around + or - inside shift

Because I was just moving my LCD pins around on my Arduino, and obviously needed to recompile the LCD4Bit library to reflect these changes. It wasn't playing ball, so I thought...I'll download the LCD4Bit library again in case something has been corrupted during all my playing around. But then I realised, even the LiquidCrystal library isn't working - maybe I killed the LCD? At which point, I noticed a switched wire on a couple of the DB pins from Arduino to LCD. Half the problem solved.

Long story short, my LCD is now wired up correctly and the LiquidCrystal library is working. The real problem is this, when I compile LCD4Bit...I'm getting the error message above and the LCD just shows funny lines and special characters instead of "Hello World!" - which sounded just like what's happening to you.

So, do you get the above error when you tried to compile LCD4Bit? It has been working fine for me but I'm wondering if someone has updated the LCD4Bit library since I originally downloaded it and before you downloaded it.

Could be a coincedence? Seems possible to me. What do you think?

Ps. I found two sites on Google top ten results that say the S6A0069 is 100% compatible with the HD47780, so you'd think that you should be right in using both librarys.

I'm smelling a rat!

have the same problem with the "suggest parentheses"

compiles under 12 fine, but at 15 it failes :-[

I get this error on 15 too just downloaded the lib and installed tonight.

LCD4Bit.cpp: In member function 'void LCD4Bit::init()':
LCD4Bit.cpp:174: warning: suggest parentheses around + or - inside shift