'Wire' does not name a type

Issue #51 closed
Pierre Montet created an issue

I use a Sainasmart LCD 2004 I2C screen. I use the IDE 1.6.1 to 1.6.3 .

My compile return me :

C:\tmp\Arduino Compilateur\arduino-1.6.1\libraries\LiquidCrystal_V1.3\I2CIO.cpp:54:3: error: 'Wire' does not name a type
C:\tmp\Arduino Compilateur\arduino-1.6.1\libraries\LiquidCrystal_V1.3\I2CIO.cpp:55:3: error: 'error' does not name a type
   error = Wire.endTransmission();
C:\tmp\Arduino Compilateur\arduino-1.6.1\libraries\LiquidCrystal_V1.3\I2CIO.cpp:56:3: error: expected unqualified-id before 'if'
   if (error==0){
C:\tmp\Arduino Compilateur\arduino-1.6.1\libraries\LiquidCrystal_V1.3\I2CIO.cpp:59:3: error: expected unqualified-id before 'else'
   else //Some error occured
C:\tmp\Arduino Compilateur\arduino-1.6.1\libraries\LiquidCrystal_V1.3\I2CIO.cpp:63:1: error: expected declaration before '}' token

This error does not exist with the 1.2.1 version. It exist with the Download repository version (1.2.2 ???)

Thanks for your help !!!

Comments (8)

  1. Francisco Malpartida repo owner

    The library hasn't been qualified with the Arduino 1.6.x. This is a working in progress task. I hate it when they break the interfaces in Arduino.

  2. Francisco Malpartida repo owner

    They have changed the include path management. Can you try the development branch. I. E. Download from the main stream. I do remember fixing this one a while back.

  3. Francisco Malpartida repo owner

    Could you try to change in file I2CIO.h #include <../Wire/Wire.h> by #include <Wire.h>?

    In principle it should fix it.

  4. Francisco Malpartida repo owner

    Comment from forum thread: I figured out the problem. It's not enough to put "#include <Wire.h>" in the source file you are using the library in. It seems you must also put "#include <Wire.h>" in the main *.ino file for the sketch as well, before it can be used in any other source code files.

    I will need to review the examples to see if it fixes the problem.

  5. srul76

    i had the same issue when i comment the below lines it start to works for me (in the I2CIO.h file) i didn't figured out what those lines do but i wanted to see somthing on my LCD and it is working now... :)

    BTW - i was needed to play with screw behind the LCD to reduce the contrast...

    // Wire.beginTransmission(DisplayI2CAddress); // error = Wire.endTransmission(); // if (error==0){ // return 1; // } // else //Some error occured // { // return 0; // } //}

  6. Log in to comment