#include<..wire/wire.h> error using i2c lcd display

Hello everybody, this is my first post, so I want to apologise if I will make any mistakes or I won't explain my problem good enough.

So, a few days back I bought a 16x02 i2c lcd display, and I managed to make it work doing like in the link below, with the same library(LiquidCrystal_V1.2.1).

http://forum.arduino.cc/index.php?topic=128635.0

I used the exemple posted in the first post, and I used the same instructions/functions for my project and it worked perfectly!

After this, I tried to make a few modifications to my code, but nothing about the lcd instructions and I think I updated the LCD library, as the compiler said there are updates available.

From this point, I couldn't run my project, nor the exemple anymore.

I thought the problem was that update for the library, so I deleted it and reinstalled the original library, but the error persisted.

This is the error:

Arduino: 1.6.7 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Users\sam\Desktop\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.

And this is the exemple I used from that link:

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

#define I2C_ADDR    0x3F // <<----- Add your address here.  Find it from I2C Scanner
#define BACKLIGHT_PIN     3
#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7

int n = 1;

LiquidCrystal_I2C  lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

void setup()
{
 lcd.begin (16,2); //  <<----- My LCD was 16x2
 
// Switch on the backlight
lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
lcd.setBacklight(HIGH);
lcd.home (); // go home

 lcd.print("SainSmartI2C16x2");  
}

void loop()
{
 // Backlight on/off every 3 seconds
 lcd.setCursor (0,1);        // go to start of 2nd line
 lcd.print(n++,DEC);
 lcd.setBacklight(LOW);      // Backlight off
 delay(3000);
 lcd.setBacklight(HIGH);     // Backlight on
 delay(3000);
}

I searched a lot but i couldn't find a proper solution for this, does anyone know what I should do to make it work again?

PS: I want to mention that I still have the code running in my board, because after that, I couldn't make it compile again, so no chance to upload it.

Look at the I2CIO.cpp file. If it really says

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

change it to

 #include <Wire.h>
1 Like

Thank you very much! It worked!
I guess I should not update that library anymore!

PaulS:
Look at the I2CIO.cpp file. If it really says
#include <../Wire/Wire.h>
change it to
#include <Wire.h>

The versions of I2CIO.cpp that I have seen (from Malpartita) have the following lines

#if (ARDUINO <  100)
   #include <WProgram.h>
#else
   #include <Arduino.h>
#endif

#if (ARDUINO < 10000)
   #include <../Wire/Wire.h>
#else
   #include <Wire.h>
#endif

#include <inttypes.h>

#include "I2CIO.h"

now I'm running IDE 1.6.9 under win10 and I don't get the error reported, it seems that the value of ARDUINO returned by my system is 10609.
A colleague is running 1.6.9 under win 7 and the error is hitting him with the same error reported by the op.
Apart from the win7 win10 difference the only difference that I know of between us is that his library is in programfiles\arduino\libraries and mine is in documents\arduino\libraries.
Dave

A colleague is running 1.6.9 under win 7 and the error is hitting him with the same error reported by the op.

So, why not do the obvious?

Delete

#if (ARDUINO < 10000)
   #include <../Wire/Wire.h>
#else
   #include <Wire.h>
#endif

and put in:

   #include <Wire.h>

Just curious.

It it so obvious? this is the error line reported at the beginning of this thread:

C:\Users\sam\Desktop\Arduino\libraries\LiquidCrystal\I2CIO.cpp:35:26: fatal error: ../Wire/Wire.h: No such file or directory

Why is ../Wire/Wire.h not written as ..**Wire**Wire.h ?

To me it seems that changing ../Wire/Wire.h to ..\Wire\Wire.h is the correct thing to do even though replacing the entire if..else..endif with #include <Wire.h> seems to have worked.

What was intended by the original if else endif?

As you can see from the number of posts I've made I'm still a Newbee and I had discovered the ARDUINO 'variable' while investigating this problem.

ARDUINO 100 seems to be IDE ver 1.0, so what is ARDUINO 10000? IDE ver 1.0.0?

But more specifically why is my colleagues IDE 1.6.9 taking the route
#if (ARDUINO < 10000)
#include <../Wire/Wire.h>

while my IDE 1.6.9 is taking the route
#else
#include <Wire.h>

Unfortunately for further investigation he removed all reference to Arduino from his PC over the weekend and re-installed the Arduino software and no longer has the problem !!!!!!

I have just one other query the file I quoted has

#if (ARDUINO <  100)
   #include <WProgram.h>
#else
   #include <Arduino.h>
#endif

#if (ARDUINO < 10000)
   #include <../Wire/Wire.h>
#else
   #include <Wire.h>
#endif

What is the effective difference between (ARDUINO < 100) and (ARDUINO < 10000)? I assume IDE ver 1.0.0 never existed
Regards
Dave

I assume IDE ver 1.0.0 never existed

Why?

Lots of things that the Arduino team does are mysteries, like changing the value set for Arduino from 1xy to 1xxyy.

To the compiler, the slash is just a directory separator. Its political leaning is irrelevant.

because it doesn't make sense to return to 1.0.0 after 1.0 thru 1.99 (or 1.999999999999 :slight_smile: )

So the compiler really doesn't care if its ..\wire\wire.h or ../wire/wire.h or any mixture thereof, it still goes up one directory level and tries to get wire.h from directory wire? Is that really true?

Is that really true?

Yes.

i have the same problem help me

D:\materi semester 7\LONGSOR\program\LCD\LCD.ino:2:17: fatal error: LCD.h: No such file or directory

#include <LCD.h>

^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

can help me please?
what should i do for my problem?

sulkhi:
D:\materi semester 7\LONGSOR\program\LCD\LCD.ino:2:17: fatal error: LCD.h: No such file or directory

#include <LCD.h>

^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

can help me please?
what should i do for my problem?

Please don't hijack threads. Your problem has nothing to do with the topic of this thread.

You probably need to install the library.

Hi!

I'we got the same problem, when I want to use this library:
https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home

The Problem was, an adressing in this file: 'I2CIO.cpp'

I have modified this line: "#include <../Wire/Wire.h>"
to: "#include <Wire.h>"

Cause the original wire library is not in the same folder as the I2C LCD library.

Have a nice Day!

vizi89:
The Problem was, an adressing in this file: 'I2CIO.cpp'

I have modified this line: "#include <../Wire/Wire.h>"
to: "#include <Wire.h>"

Which version of the Arduino IDE are you using?
The code in that file:

#if (ARDUINO < 10000)
   #include <../Wire/Wire.h>
#else
   #include <Wire.h>
#endif

Should cause the problematic line to only be used with very outdated versions of the Arduino IDE (the ARDUINO macro is used to store the version number, which in the 1.8.5 IDE release is set to 10805).

Hi

wire.h: no such file or directory

i had this error recently and at last i found the answer
so i have seen there are another that have same problem.

look at the "C:\Program Files (x86)\Arduino\libraries" if there's not the folder with "Wire" name
then go to this location "C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries" and copy paste the "Wire" folder to the above location.
I'll grateful if it helps.

nader_mrt:
look at the "C:\Program Files (x86)\Arduino\libraries" if there's not the folder with "Wire" name
then go to this location "C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries" and copy paste the "Wire" folder to the above location.

That's a bad idea. The Wire library is architecture specific. Every hardware package bundles its own version of the Wire library, which is written specifically for that architecture. The Wire library located at C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire is the AVR version of the library. The library at that location will only be visible to the Arduino IDE when you have an AVR board selected from the Tools > Board menu. However, the libraries installed under C:\Program Files (x86)\Arduino\libraries are visible no matter which board you have selected. This means that if you install the AVR library to that folder, it's possible that the Arduino IDE would attempt to use the AVR version of the Wire library for boards of other architectures.

The correct way to deal with this error is to fix that garbage code in the library, as I have already described above. Likely with a bit of searching, you'll find an updated version of the library that already has been fixed for you.