No such file

Can anybody tell me why when I click on verify that I get an ‘error compiling’ no such file LiquidCrystal_I2C.h. The other two subdirectories seem to work ok and all the three directories are in the same folder. I have also tried an older Liquid Crystal file but just get the same error message

#include <Wire.h> // use Wire library for protocol i2c (A4 = SDA & A5 = SCL)
#include <LiquidCrystal_I2C.h> // use LiquidCrystal_I2C library for control LCD on i2c protocol
#include <VirtualWire.h> // use Virtual library for decode signal from Rx module

byte thermometer[8] = //icon for thermometer
{
B00100,
B01010,
B01010,
B01110,
B01110,
B11111,
B11111,
B01110
};

byte droplet[8] = //icon for droplet
{
B00100,
B00100,
B01010,
B01010,
B10001,
B10001,
B10001,
B01110,
};
byte hi[8]= //icon for heat index
{
0B00000,
0B00000,
0B10101,
0B01110,
0B11111,
0B01110,
0B10101,
0B00000,
}; //(addr, EN,RW,RS,D4,D5,D6,D7,BL,BLpol)
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); //change the address as per your I2C module
// Sensors
int humidity=0;
int temp=0;
int heat_index=0;
char MsgReceived[21];
int led = 13; //pin for LED

void setup()
{
lcd.begin(20,4); // set up the LCD’s number of columns and rows:
lcd.backlight(); //backlight is now ON
pinMode(led, OUTPUT);

// VirtualWire
// Bits per sec
vw_setup(2000);
// set pin for connect receiver module
vw_set_rx_pin(11);
// Start the receiver PLL running
vw_rx_start();

lcd.begin(20,4); // initialize the lcd for 20 chars 4 lines, turn on backlight
lcd.backlight(); // finish with backlight on
lcd.createChar(1, thermometer);
lcd.createChar(2, droplet);
lcd.createChar(3,hi);
lcd.clear(); // clear the screen

} // END void setup

void loop()
{
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
//Taking the data from the control base
if (vw_get_message(buf, &buflen))
{
digitalWrite(led, HIGH);
delay(100);
int i;
// Message with a good checksum received, dump it.
for (i = 0; i < buflen; i++)
{
// Fill Msg Char array with corresponding
// chars from buffer.
MsgReceived = char(buf*);*
_ //Serial.print(MsgReceived*);
}_
sscanf(MsgReceived, “%d,%d,%d”,&humidity, &temp,&heat_index); // Converts a string to an array*

* digitalWrite(led, LOW);*
* lcd_display();
_ memset( MsgReceived, 0, sizeof(MsgReceived));// This line is for reset the StringReceived*
* }
}
void lcd_display()
{ lcd.setCursor(1,0);
lcd.print(" WEATHER STATION “);
lcd.setCursor(4,1);
lcd.print(“TEMP”);
lcd.setCursor(9, 1);
lcd.write(1);
lcd.setCursor(11, 1);
lcd.print(temp);
lcd.write(0b11011111);
lcd.print(“C”);
lcd.setCursor(4,2);
lcd.print(“HUM”);
lcd.setCursor(9, 2);
lcd.write(2);
lcd.setCursor(11, 2);
lcd.print(humidity);
lcd.print(”%");
lcd.setCursor(4,3);
lcd.print(“HI”);
lcd.setCursor(9, 3);
lcd.write(3);
lcd.setCursor(11, 3);_
lcd.print(heat_index);
_ lcd.write(0b11011111);
lcd.print(“C”);
}*_

moderator: please use code tags, parts of C code gets interpreted as forum tags, that is why the code goes italic

You seem to still (as you did here: http://forum.arduino.cc/index.php?topic=288562.0 ) have a problem with the installation of your library files.

First of all if you follow the recommendations the three libraries will not be in the same folder since the wire library comes with the IDE and the others come from elsewhere.

Secondly you may have a conflict between the various I2C libraries that you have tried. They are not "mix and match". Each 'filename.cpp' file has it's own corresponding 'filename.h' file. Even though they may have the same names you cannot use the .cpp file from one source with the .h file from another.

Don

yup it did seem I had old files mixed with new. So I did a bit of cleaning up and sorted that problem. Then I got a new problem related to the LiquidCrystal.h file saying that it could not open the WProgram.h file this I think I sorted due to remembering something I came across on line, by adding the lines

if defined(ARDUINO) && ARDUINO >= 100

include "Arduino.h"

else

include "WProgram.h"

endif

but now when I ask to verify the file the following comes up

ERROR COMPILLING

In file included from LiquidCrystal_I2C.cpp:1:0: LiquidCrystal_I2C.h:80:16: error: conflicting return type specified for 'virtual void LiquidCrystal_I2C::write(uint8_t)' virtual void write(uint8_t); ^ In file included from LiquidCrystal_I2C.h:5:0, from LiquidCrystal_I2C.cpp:1: C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:48:20: error: overriding 'virtual size_t Print::write(uint8_t)' virtual size_t write(uint8_t) = 0; ^ LiquidCrystal_I2C.cpp: In member function 'void LiquidCrystal_I2C::expanderWrite(uint8_t)': LiquidCrystal_I2C.cpp:245:7: error: 'class TwoWire' has no member named 'send' Wire.send((int)(_data) | _backlightval); ^ Error compiling.

Apologies to the moderators for the way I include I write my messages, once I have sorted out how to write sketches for the Arduino I will learn how to post properly please be patient with me thank you

First things first. We can't help you with your code until it is posted properly. When code is not in a code window certain combinations of characters are misinterpreted and therefore improperly displayed in the forum.

Which I2C library are you using? If it is not the one authored by 'fm' you are probably wasting your time. The library that you are using is obviously obsolete if it was looking for WProgram.h .

Don

Ok well I think I have managed to upload the file the correct way, as for ‘FM’ I have no idea what that means however I do believe I downloaded the LiquidCrystal.zip from the Arduino website. I totally agree with you when you say it’s a problem with the LiquidCrystalI2c file as any other project I have done works great it’s just the ones with the LCD

WeatherRx.ino (2.76 KB)

... as for 'FM' I have no idea what that means ...

You obviously have not done your homework. If you look back through the pages of this forum section you will find many topics dealing with I2C LCD adapters. The general consensus is that the only library currently worth using is the one authored by Francisco Malpartida aka fm.

Don

Well it turns out the Library I am using for the LCD is indeed by FM and was downloaded from a link on this site. Now that I've cleared that one up does anybody have a clue why any sketch I try to use that uses the LiquidCrystal_I2C.h returns a compile error.

You still haven't responded to the request of the moderator in the very first reply to this thread. In reply #4 I tried to explain why this request was important. Your error messages should be in code tags for the same reasons.

I for one have not looked at a single line of your code or error messages and do not intend to do so until it is properly formatted.

Now that I've cleared that one up ...

You haven't really cleared that one up yet. You may have used an old link or a new link to an old version. Of course if you told us which version you are using or where you got it from we could check it out.

I suggest that you start out with a simpler sketch that uses only the I2C LCD library in question and only displays a simple static message on that display. In other words, loop() should be empty between the curly brackets.

Don

Ok sorry as I said before I’m new to this site I’m new to Arduino and I’m new to programming so I ask you to be patient with me. The version of LiquidCrystal_I2C I’m using at the moment is v1.2.1 which was downloaded off the FM website. I seem to remember two older versions being available and tried them but just get the same error message.
I don’t know how to post the error message but when you verify it, it just says no such file or directory referring to the LiquidCrystal_I2C

#include <Wire.h> // use Wire library for protocol i2c (A4 = SDA & A5 = SCL)
#include <LiquidCrystal_I2C.h> // use LiquidCrystal_I2C library for control LCD on i2c protocol
#include <VirtualWire.h> // use Virtual library for decode signal from Rx module

byte thermometer[8] = //icon for thermometer
{
  B00100,
  B01010,
  B01010,
  B01110,
  B01110,
  B11111,
  B11111,
  B01110
};

byte droplet[8] = //icon for droplet
{
  B00100,
  B00100,
  B01010,
  B01010,
  B10001,
  B10001,
  B10001,
  B01110,
};
byte hi[8]=    //icon for heat index
{
  0B00000,
  0B00000,
  0B10101,
  0B01110,
  0B11111,
  0B01110,
  0B10101,
  0B00000,
};                 //(addr, EN,RW,RS,D4,D5,D6,D7,BL,BLpol)
LiquidCrystal_I2C lcd(0x27, 2, 1, 4, 5, 10, 11, 12, 13); //change the address as per your I2C module
// Sensors 
int humidity=0;
int temp=0;
int heat_index=0;
char MsgReceived[21]; 
int led = 13; //pin for LED

void setup() 
{
  lcd.begin(20,4); // set up the LCD's number of columns and rows: 
  lcd.backlight(); //backlight is now ON
  pinMode(led, OUTPUT); 

  // VirtualWire 
  // Bits per sec
  vw_setup(2000);
  // set pin for connect receiver module 
  vw_set_rx_pin(11);  
  // Start the receiver PLL running
  vw_rx_start();       

  lcd.begin(20,4);   // initialize the lcd for 20 chars 4 lines, turn on backlight
  lcd.backlight(); // finish with backlight on  
  lcd.createChar(1, thermometer);
  lcd.createChar(2, droplet);
  lcd.createChar(3,hi);
  lcd.clear(); // clear the screen

} // END void setup

void loop()
{
  uint8_t buf[VW_MAX_MESSAGE_LEN];
  uint8_t buflen = VW_MAX_MESSAGE_LEN;
  //Taking the data from the control base
  if (vw_get_message(buf, &buflen)) 
  {
    digitalWrite(led, HIGH);
    delay(100);
    int i;
    // Message with a good checksum received, dump it. 
    for (i = 0; i < buflen; i++)
    {            
      // Fill Msg Char array with corresponding 
      // chars from buffer.   
      MsgReceived[i] = char(buf[i]);
      //Serial.print(MsgReceived[i]);
    }

    sscanf(MsgReceived, "%d,%d,%d",&humidity, &temp,&heat_index); // Converts a string to an array
    digitalWrite(led, LOW); 
    lcd_display();
    memset( MsgReceived, 0, sizeof(MsgReceived));// This line is for reset the StringReceived
  }
}
void lcd_display()
{ lcd.setCursor(1,0);
  lcd.print(" WEATHER STATION ");
  lcd.setCursor(4,1);
  lcd.print("TEMP");
  lcd.setCursor(9, 1);
  lcd.write(1);
  lcd.setCursor(11, 1);
  lcd.print(temp);
  lcd.write(0b11011111);
  lcd.print("C");
  lcd.setCursor(4,2);
  lcd.print("HUM");
  lcd.setCursor(9, 2);
  lcd.write(2);
  lcd.setCursor(11, 2);
  lcd.print(humidity);
  lcd.print("%");
  lcd.setCursor(4,3);
  lcd.print("HI");
  lcd.setCursor(9, 3);
  lcd.write(3);
  lcd.setCursor(11, 3);
  lcd.print(heat_index);
  lcd.write(0b11011111);
  lcd.print("C");
}

OK I think I have figured it out. The problem is right here.

#include <LiquidCrystal_I2C.h> // use LiquidCrystal_I2C library for control LCD on i2c protocol

Your ‘include’ statement specifies ‘LiquidCrystal_I2C’ but that is not the name of the library.

Unlike most I2C libraries which work with the regular LiquidCrystal library the one written by fm is a replacement for the regular LiquidCrystal library. As I recall his library comes with specific instructions that tell you how it is to be installed.

Don

it just says no such file or directory referring to the LiquidCrystal_I2C

There is still something wrong with your installation of the FM library. I have mine in a folder name LiquidCrystal located in my user file library folder. The library folder in the Arduino program files directory contains nothing called LiquidCrystal.

If you open the LiquidCrystal library folder you will see an whole bunch of .cpp and .h files. One set of them should be called LiquidCrystal_I2C.h and the other LiquidCrystal_I2C.cpp.

In the sketch I use #include <LiquidCrystal_I2C.h> and with IDE 1.0.5 r2 it shows up in red.

To use the FM library you also need #include <Wire.h>.

I have reread the information from FM here → https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home and from Terry here → http://arduino-info.wikispaces.com/LCD-Blue-I2C and have concluded that the first part of my previous post (reply #10) isn’t correct.

I agree that you are still having problems with your library installation.

In summary I think the least that you have to do (there may be more) is:

  • Remove, move, or rename the original LiquidCrystal library that came with the IDE
  • Remove, move, or rename any other I2C libraries that you have been tinkering with
  • Unzip FMs library and put the folder named LiquidCrystal, along with all of it’s subfolders, where the IDE can find it.
  • If you are using a naked parallel LCD module then use #include <LiquidCrystal.h>
  • If you are using a parallel LCD with an I2C adapter then use #include <LiquidCrystal_I2C.h> and #include <Wire.h>

Apparently the IDE can find LiquidCrystal_I2C.h even though it is in a folder called LiquidCrystal although that doesn’t make sense to me.

Don

To clarify what cattledog said:

There is still something wrong with your installation of the FM library. I have mine in a folder name LiquidCrystal located in my user file library folder. The library folder in the Arduino program files directory contains nothing called LiquidCrystal.

After he installed FMs library in his user file library folder he went back and removed, moved, or renamed the original LiquidCrystal library. That is why "The library folder in the Arduino program files directory contains nothing called LiquidCrystal."

If you open the LiquidCrystal library folder you will see an whole bunch of .cpp and .h files. One set of them should be called LiquidCrystal_I2C.h and the other LiquidCrystal_I2C.cpp.

Here he is referring to FMs library, not the original LiquidCrystal library.

Don

Thank you to Floresta and Cattledog for your help but I found the problem it seems I have two library folders in two totally different locations. When I was adding a library in the Sketch, import/add Library, Add library the IDE was saving the new library files to the Library folder that the IDE was not using. To correct the problem I had to de 'install the IDE and the other Library folder then reinstall and reload all my library folders. The sketch now does not come up with any errors, but I cant test it properly until the 20 x 4 I2C LCD arrives but all sketches that use a 16 x2 I2C LCD now work so I live in hope. Thanks again guys