Sainsmart 2004 LCD with I2C piggyback controller

Hello,
I am still pretty new to arduino - but not to programming in general.
So I bought a Sainsmart 2004 20x4 Display and just can't quite get it to work.
On the back it says 2014 02 - does this mean it is the second version?

Following Problem:

After loading the test program the display just starts to flicker. The tact of flickering can be controlled by a DELAY() in the Void Loop().

My main question:

There are many libs out there for this display - so far none have worked. Can anyone tell me which one will be right?
I really think I just have the wrong lib included.

Id be very thankful for any input.

Thanks!
Daniel

On the back it says 2014 02 - does this mean it is the second version?

Most likely it means that the pc board was manufactured in February the second week of 2014.

After loading the test program the display just starts to flicker. The tact of flickering can be controlled by a DELAY() in the Void Loop().

That's interesting. Perhaps if we could see the program we could make an intelligent response.

There are many libs out there for this display - so far none have worked. Can anyone tell me which one will be right?

Didn't Sainsmart have any recommendations?

You might get some ideas here http://arduino-info.wikispaces.com/LCD-Blue-I2C and perhaps consider purchasing from a source that gives support in the future.:

Don

Hey Don,
thank you for the quick reply!

Thanks for the Link! I've tried the lib "LiquidCrystal_V1.2.1.zip" - I believe I should use the newest one? (Also I tried the rest - none worked)
To test the Display I used the example from the ZIP file.

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>



#define BACKLIGHT_PIN     13

LiquidCrystal_I2C lcd(0x3F);  // Set the LCD I2C address

//LiquidCrystal_I2C lcd(0x38, BACKLIGHT_PIN, POSITIVE);  // Set the LCD I2C address


// Creat a set of new characters
const uint8_t charBitmap[][8] = {
   { 0xc, 0x12, 0x12, 0xc, 0, 0, 0, 0 },
   { 0x6, 0x9, 0x9, 0x6, 0, 0, 0, 0 },
   { 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0, 0x0 },
   { 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0, 0x0 },
   { 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0x0 },
   { 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0x0 },
   { 0x0, 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0x0 },
   { 0x0, 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0x0 }
   
};

void setup()
{
   int charBitmapSize = (sizeof(charBitmap ) / sizeof (charBitmap[0]));

  // Switch on the backlight
  pinMode ( BACKLIGHT_PIN, OUTPUT );
  digitalWrite ( BACKLIGHT_PIN, HIGH );
  
  lcd.begin(16,2);               // initialize the lcd 

   for ( int i = 0; i < charBitmapSize; i++ )
   {
      lcd.createChar ( i, (uint8_t *)charBitmap[i] );
   }

  lcd.home ();                   // go home
  lcd.print("Hello, ARDUINO ");  
  lcd.setCursor ( 0, 1 );        // go to the next line
  lcd.print (" FORUM - fm   ");
  delay ( 1000 );
}

void loop()
{
   lcd.home ();
   // Do a little animation by writing to the same location
   for ( int i = 0; i < 2; i++ )
   {
      for ( int j = 0; j < 16; j++ )
      {
         lcd.print (char(random(7)));
      }
      lcd.setCursor ( 0, 1 );
   }
   delay (200);
}

Does anyone know, which Lib to use? Could someone just make up something very small (just print s.th. on the Display)? I think from there on I could untangle myself - but for now all that shows on the display is the 1. and 3. Line Black for contrast...

Thanks for any help!
-Daniel

You've got the right library and it does work.
You need to properly fill in the full constructor to tell the library how the PCF8574 chip is wired up to the LCD.
I guarantee you that this one, is wrong:

LiquidCrystal_I2C lcd(0x3F);  // Set the LCD I2C address

As that one will use an internal default pin mapping which sets the pin mappings to work
with Fm's ElectronFun pin wiring which no other backpack uses.

My recommendations is to ALWAYS fill in the full constructor with the full pin mappings
so you know what you getting vs trying to use built in defaults.

Look closer at the constructor and its full set of arguments.
There are examples on using the full constructor on the link that Don provided.
You will notice that your constructor doesn't look like the ones on that page.

Also, if you search the forum you can find my i2cLCDguesser sketch that will guess the
constructor.
http://forum.arduino.cc//index.php?topic=157817.msg1235230#msg1235230

--- bill