I bought a i2c and a 16x2 lcd for my arduino

I bought a i2c and a 16x2 lcd for my arduino and it just does not want to compile
This is what it says

C:\Users\Linwood Corp Sales\Documents\Arduino\libraries\LiquidCrystal\I2CIO.cpp:35:26: fatal error: ../Wire/Wire.h: No such file or directory

#include <../Wire/Wire.h>

^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

Not really sure what that means

I have tried a few different libraries. I put in the right address.The COM port is right and if i run the BLINK sketch it works to compile it.

Really hope i can get it fixed

What happens if you change it to:

#include <Wire.h>

This is my code that does not work:

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

#define BACKLIGHT_PIN 13

LiquidCrystal_I2C lcd(0x27); // 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 );

  • }*
  • 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);*
    }

I've used these I2C LCD's a lot, using the library you show. I instantiate it with

LiquidCrystal_I2C lcd(0x27, 20, 4)

representing I2C address, # columns, # rows.

the initialization command is just

lcd.init();

C:\Users\Linwood Corp Sales\Documents\Arduino\libraries\LiquidCrystal\I2CIO.cpp:35:26: fatal error: ../Wire/Wire.h: No such file or directory

#include <../Wire/Wire.h>

So, the I2CIO.cpp file tries to include Wire.h incorrectly, so you modified some other file. I see. And, how did that work out? Never mind. I already know.

jrdoner this is what came up;

HelloWorld_i2c:8: error: invalid conversion from 'int' to 't_backlighPol' [-fpermissive]

LiquidCrystal_I2C lcd(0x27,16,2); // Set the LCD I2C address

^

In file included from C:\Users\LINWOO~1\AppData\Local\Temp\arduino_modified_sketch_995266\HelloWorld_i2c.pde:2:0:

C:\Users\Linwood Corp Sales\Documents\Arduino\libraries\LiquidCrystal/LiquidCrystal_I2C.h:53:4: error: initializing argument 3 of 'LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, t_backlighPol)' [-fpermissive]

LiquidCrystal_I2C (uint8_t lcd_Addr, uint8_t backlighPin, t_backlighPol pol);

^

exit status 1
invalid conversion from 'int' to 't_backlighPol' [-fpermissive]

even if my i2c board wouldnt work, shouldnt still compile?
Or do you think my i2c board is dead?

Or did i modify it incorrectly;

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

#define BACKLIGHT_PIN 13

LiquidCrystal_I2C lcd(0x27,16,2); // 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 );

  • }*
  • 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);*
    }

Hi,
Can you please post a copy of your sketch, using code tags?
They are made with the </> icon in the reply Menu.
See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Thanks.. Tom. :slight_smile:

I think there are different versions of the LiquidCrystal_I2C library. I saw one with a handful of arguments and one with three arguments (as shown by jrdoner).

Libraries tend to come with examples; maybe try to compile an example first. Post the error that yu get as well as the code using code tags
type
** **[code]** **

paste your code or error message after that
type
** **[/code]** **
after that

Can you post a link to the location where you downloaded the library from?

@sterretje: You're absolutely right. I use the I2C display from Yourduino and it uses this library:

https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads

Attempting to use the "standard" I2C library does not work. The OP would have to remove the original library to try the new one.

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



#define BACKLIGHT_PIN     13

LiquidCrystal_I2C lcd(0x38);  // 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);
}

Good, we're getting somewhere :wink: And now the link to the library, please.

Hahahaha i tried so many library's I am not even sure

Why don't you tell me a good one that should work
Thanks

Do you guys think its the programming problem or would it be the hardware.

Im new to this so i just got get used with this stuff :slight_smile: :confused:

I don't have a I2C LCD :wink:

econJack posted a link to one that he uses; see reply #8

now it compiles good and also uploads awesome but acts really funky. the light is blinking on and off and i cannot see the text. no error message pops up

What happens if you compile and run some of the examples supplied with that library?

Thats what I did I ran the hello world

hooverdan:
I bought a i2c and a 16x2 lcd

What does that mean?

You bought some I2C device (which one?), connected it to the Arduino and you bought a 16x2 and connected that to the (for us) unknown device? If so, you might have made the wrong connections between the unknown device and the LCD.

Or you bought a 16x2LCD with integrated I2C.

Can you post links to what you bought?

This is what I have from Yourduino.com:

which has the I2C module connected directly to the back of the display. The sample code Terry has posted on his site works great with it. See:

http://arduino-info.wikispaces.com/LCD-Blue-I2C

and read all of the narrative posted there.

i bought a 16x2 lcd and i soldered header pins to it. the lcd works good alone

http://www.ebay.com/itm/Professional-UNO-R3-Starter-Kit-for-Arduino-Servo-Ultrasonic-Compass-Gyro-/151906054136?ssPageName=STRK:MESE:IT

i kinda messed up the title