LCD HD44780 not working with Mega2560

Hello guys,

I know this is ANOTHER topic about the LCD not working but I’ve been struggling for quite a while now and I’ve reached the point where I’ve tried ‘everything’ in the forum…

So I know that you guys want pictures but they will be added later today (around 6PM) since I’m still at school and I can’t connect my Cellphone to this PC.

the only thing that I’ve wired diffrently is a 220ohm resistor to the backlight so it won’t take that much current and steal it from other outputs (since I’ve plugged all in the arduino 5v).

School is running Arduino1.0.
I bought this HD44780 display (datasheet was not provided by the buyer but I googled this: http://web.stanford.edu/class/ee281/handouts/lcd_tutorial.pdf
the connections are made as in: the arduino LCD tutorial except I’ve changed the data-pins)


This is the program I’m running:

#include <FastIO.h>
#include <I2CIO.h>
#include <LCD.h>
#include <LiquidCrystal.h>
#include <LiquidCrystal_I2C.h>
#include <LiquidCrystal_I2C_ByVac.h>
#include <LiquidCrystal_SR.h>
#include <LiquidCrystal_SR1W.h>
#include <LiquidCrystal_SR2W.h>
#include <LiquidCrystal_SR3W.h>



LiquidCrystal lcd(40, 50, 49, 48, 47, 46);

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

void loop() {}

I know the explaination of the pins and how to program them. (Except for I2C, which I know nothing about and I’m not using if I’m not mistaken) This was very useful for it: (http://arduino.cc/en/Reference/LiquidCrystalConstructor)
I got the mega and so my pins are connected to (40,50,49,48,47,46)

The problem is: I get the notorious 16 White (I’m using a blue and white Display which doesnt really matter) squares at the top.

When adding the ‘new LCD library’ (Source: https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home)

(I download it, unzip it, rename the map ‘LCD’ and move it to the libraries folder in the Arduino folder)

I get this error when trying to upload/compile it:

C:\arduino-1.0\libraries\LCD\I2CIO.cpp:54: error: expected constructor, destructor, or type conversion before '.' token
C:\arduino-1.0\libraries\LCD\I2CIO.cpp:55: error: expected constructor, destructor, or type conversion before '=' token
C:\arduino-1.0\libraries\LCD\I2CIO.cpp:56: error: expected unqualified-id before 'if'
C:\arduino-1.0\libraries\LCD\I2CIO.cpp:59: error: expected unqualified-id before 'else'
C:\arduino-1.0\libraries\LCD\I2CIO.cpp:63: error: expected declaration before '}' token

I’ve tried the following things:

Checking the forum.
Checked the soldering.
Checked the wires for dead ones.
Checked for a new library.
Used other digital ports.

nothing worked!

I hope you guys can help me out here! Sorry for not posting pictures, I’ll search for a way to upload them, at school, while waiting for a reply

There is lot of confusion here.

Please let me know LCD you are using 16x2 or 16X4 how it is??

Whether any data line avilable or it uses I2c as data line.???

Why you added two many library if it is16x2??

here simple example code with library http://arduino.cc/en/Tutorial/LiquidCrystalDisplay

Oh guys!

I’m sorry I had my pot turned all the way around, hahahaha… So after close inspection I noticed faint words… and turned it the other way: there it was ‘Hello, world’.

Since this is so awkward this thread can be closed… :sweat_smile:

AMPS-N: There is lot of confusion here.

Please let me know LCD you are using 16x2 or 16X4 how it is??

Whether any data line avilable or it uses I2c as data line.???

Why you added two many library if it is16x2??

here simple example code with library http://arduino.cc/en/Tutorial/LiquidCrystalDisplay

Ah yes, it seems I've forgotten to tell you that I'm using a 16x2, As I said: I know nothing of I2C, I've been using the 4bit method.

The idea of a new library came from another topic, where they recommended it. I downloaded it from the link provided, then unzipped it, renamed the map 'LCD' and move it to the libraries folder in the Arduino folder. After adding the library to my sketch it gave all those libraries.