Sainsmart LCD 2004 - LiquidCrytal_I2C library issue unable to compile

Hello,

I bought a Sainsmart LCD2004 from Amazon to use with my Arduino Uno. I understand that since this LCD uses I2C a new library needs to be downloaded.

From the sainsmart website I dowloaded the LCD 2004 rar http://www.sainsmart.com/arduino/arduino-shields/sainsmart-iic-i2c-twi-serial-2004-20x4-lcd-module-shield-for-arduino-uno-mega-r3.html

When I try to compile the example titled helloworld I get the following error:

In file included from HelloWorld.pde:3: C:\Users\r_yob_000\Documents\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:81: error: conflicting return type specified for 'virtual void LiquidCrystal_I2C::write(uint8_t)' C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'

There seems to be a conflict between two functions returning different types.

I've tried searching the issue and found a lot of posts with similar errors. The solution suggested is usually that a new version of the LiquidCrytal_I2C needs to downloaded. Or that one should use Arduino IDE version 1.0

I have downloaded tons of LiquidCrytal_I2C libraries and tried them all on IDE version 1.0 and 1.0.6 and I still get the same error message. I've even tried changing the LiquidCrytal_I2C.h file so that it returns the correct type and still have no luck.

Could I please get some help with this issue.

Thank you very much.

You don't have to look at too many threads that contain both 'I2C' and 'LCD' in their titles to determine that you should be using the LiquidCrystal library written by 'F Malpartida' which you can find here: https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads

Those same threads frequently point you to the tutorial by 'Terry King' which you can find here: http://arduino-info.wikispaces.com/LCD-Blue-I2C

They are both frequent contributors to this forum.

Don

This product has changed over the years. I ordered this LCD in 11/2015 and using the i2c scanner I found out that mine is 0x27 (like one of the other comments say). Mine came from sainsmart/amazon with the PCF8574 I2C chip.

Here is how I got it working:

Download latest library from https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home#!downloading-and-installation

Open up the Example > HelloWorld_I2C and change the default pin assignments to this:

#include “LiquidCrystal_I2C.h”
#define BACKLIGHT_PIN (3)
#define LED_ADDR (0x27) // might need to be 0x3F, if 0x27 doesn’t work
LiquidCrystal_I2C lcd(LED_ADDR, 2, 1, 0, 4, 5, 6, 7, BACKLIGHT_PIN, POSITIVE) ;

These pin assignments change, thanks for the info from http://brainwagon.org/2015/04/22/using-a-sainsmart-lcd-panel-with-the-arduino-1-6-3-ide/ where Mark VandeWettering explains how the pin assignments can be configured in this new-lcdlibrary, in all the other libraries the pin assignments are hardcoded… so if you are having problems look at that brainwagon page. My