I2C LCD, first project, need help!

Hi everyone!

This is my first project with Arduino and well... I bought a 20x4 i2c LCD and I can't make it works with my arduino mega.

This is what I bought : http://www.robotshop.com/productinfo.aspx?pc=RB-Dev-57&lang=en-US

I'm pretty sure I plugged it correctly. It displays: LCD03 REVISION9 I2CMODE @ 0xC6

When I scan for I2C device, it says the address is 0x63

I downloaded the new liquidCrystal library and tried the i2c example. Everything seems to upload well, but nothing change on the screen :(

Does someone have an idea of what I'm doing wrong? Thanks!

ps: my ide version is 1.0.4

You sure the I2C address isn't 0xC6 like displayed on the screen?

No, I'm not sure XD

But I tried them both already to make sure. :-/

0x63 is the correct address to use with the Arduino I2C code.

Pete

Ok then… what’s the problem? =(

The code looks like this for now

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



#define BACKLIGHT_PIN     13

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

//LiquidCrystal_I2C lcd(0x63, 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(20,4);               // 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);
}

From the datasheet the address is displayed on the screen, so it is 0xC6.

I think you don't need LiquidCrystalI2c, the screen you bought uses i2c but not the same way this library does. Did you add pullups on the SCL and SDA lines?

Try with the wire library

void setup() {
  Wire.begin();
  Wire.beginTransmission(0x86); // we're supposed to ditch the 8th bit, the library takes care of it
  Wire.write(1); // set cursor to top left
  Wire.write("Fluttershy rocks");
  Wire.endTransmission();
}

I had a similar problem with an 16x2, reconfiguring the wiring solved the problem, check the following tutorial

http://www.ucontrolit.tv/arduino-bb1/

It woooorks :D

Thanks Semicolo ^^ I didn't use any pullups, but it works fine! I had to use 0x63 for the address though :P

Thanks again!!