LiquidCrystal_IC2 error

Been using my sketch for some time now, but today I wanted to make some changes. But I get this error.

Serial_LCD_030216:62: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)' Serial_LCD_030216.ino:62:87: note: candidates are: In file included from Serial_LCD_030216.ino:12:0:

Worked fine several days ago and I didn't change anything yet.

Paul

The code may help in the answer. But, for what is the error message your problem is the number of pins that you are using in the initialization of the LCD.

define I2C_ADDR 0x27 // Define I2C Address where the PCF8574A is

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

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

I'm using a Serial LCD, 4 wires +, -, SDA & DCL

I have to use this code to make this work, and it worked fine yesterday. I even tried and older version of mu code and that didn't work either

Where did you get this?

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

You have to understand that the En, Rw, Rs, D4, D5, D6, and D7 pins are for hooking up an LCD directly. If you're using I2C to drive your LCD then that will take a different set of pins, a +, -, SDA, and SCL. The LiquidCrystal_I2C library expects you to tell it about the pins it needs to know about or any other parameters related to I2C, not the pins that you would have used if you hadn't been using I2C. Look at the documentation for the LiquidCrystal_I2C library and see what it expects to get in its constructor.

I looked online for info on the 20 x 4 LCD and this is what I came up with.

But what I don't understand is, that if it worked yesterday why don't it work today.

Were you using LiquidCrystal_I2C yesterday or just LIquidCrystal? I am absolutely certain that this code never worked with the LiquidCrystal_I2C library. You must have changed something you don't realize.

Don't look for info on the 20 x 4 LCD. Look a the documentation for the LiquidCrystal_I2C library that you want to use to run it.

I understand what you are saying, I went back to the 2/12/16 sketch that I saved and it is using the LiquidCrystal_IC2.h library also. I tried the LiquidCrystal.h library but that didn’t work.

K1PL: I understand what you are saying, I went back to the 2/12/16 sketch that I saved and it is using the LiquidCrystal_IC2.h library also. I tried the LiquidCrystal.h library but that didn't work.

And it has that same line in it and compiles? I doubt it. Try to compile it again. If it compiles then post both sketches so we can look at the difference.

The older one does not work either.

K1PL: The older one does not work either.

That's what I thought. Now go look at the documentation for LiquidCrystal_I2C and see what it expects to have in its constructor. It surely won't be pins related to how you would hook the LCD up using a different method of communication. Surely it wants to know things related to how you hook the LCD up to use I2C.

It’s been working for the last 3 months. The Arduino Megs is still working right now, just cant access it.
I tried downloading several sketches for the I2C Get a new error for each one.
I thought The LiquidCrystal_I2C.h was corrupt and downloaded the zip file again.
That didn’t help. I’m even using a different Arduino. Still don’t work
Here’s the code I downloaded.
/* YourDuino.com Example Software Sketch
20 character 4 line I2C Display
Backpack Interface labelled “YwRobot Arduino LCM1602 IIC V1”
Connect Vcc and Ground, SDA to A4, SCL to A5 on Arduino
terry@yourduino.com */

/-----( Import needed libraries )-----/
#include <Wire.h> // Comes with Arduino IDE
// Get the LCD I2C Library here:
// https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
// Move any other LCD libraries to another folder or delete them
// See Library “Docs” folder for possible commands etc.
#include <LiquidCrystal_I2C.h>

/-----( Declare Constants )-----/
/-----( Declare objects )-----/
// set the LCD address to 0x27 for a 20 chars 4 line display
// Set the pins on the I2C chip used for LCD connections:
// addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
int Positive
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3,Positive); // Set the LCD I2C address

/-----( Declare Variables )-----/

void setup() /----( SETUP: RUNS ONCE )----/
{
Serial.begin(9600); // Used to type in characters

lcd.begin(20,4); // initialize the lcd for 20 chars 4 lines, turn on backlight

// ------- Quick 3 blinks of backlight -------------
for(int i = 0; i< 3; i++)
{
lcd.backlight();
delay(250);
lcd.noBacklight();
delay(250);
}
lcd.backlight(); // finish with backlight on

//-------- Write characters on the display ------------------
// NOTE: Cursor Position: Lines and Characters start at 0
lcd.setCursor(3,0); //Start at character 4 on line 0
lcd.print(“Hello, world!”);
delay(1000);
lcd.setCursor(2,1);
lcd.print(“From YourDuino”);
delay(1000);
lcd.setCursor(0,2);
lcd.print(“20 by 4 Line Display”);
lcd.setCursor(0,3);
delay(2000);
lcd.print(“http://YourDuino.com”);
delay(8000);
// Wait and then tell user they can start the Serial Monitor and type in characters to
// Display. (Set Serial Monitor option to “No Line Ending”)
lcd.setCursor(0,0); //Start at character 0 on line 0
lcd.print(“Start Serial Monitor”);
lcd.setCursor(0,1);
lcd.print(“Type chars 2 display”);

}/–(end setup )—/

void loop() /----( LOOP: RUNS CONSTANTLY )----/
{
{
// when characters arrive over the serial port…
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.clear();
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());
}
}
}

}/* --(end main loop )-- */

/* ( THE END ) */

And these are the errors I Get
Serial_LCD_030616a:21: error: expected initializer before ‘LiquidCrystal_I2C’
Serial_LCD_030616a.ino: In function ‘void setup()’:
Serial_LCD_030616a:31: error: ‘lcd’ was not declared in this scope
Serial_LCD_030616a.ino: In function ‘void loop()’:
Serial_LCD_030616a:76: error: ‘lcd’ was not declared in this scope
expected initializer before ‘LiquidCrystal_I2C’

Thanks for you help.

//int Positive
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3,POSITIVE);  // Set the LCD I2C address

Somehow you have messed up the example sketch. Delete the "int positive" and change the word in the constructor to caps. It compiles for me with those changes.

Here is a link to the examples on Terry's site and I see nothing with the syntax you posted http://arduino-info.wikispaces.com/LCD-Blue-I2C

OK
I made those changes, Because POSITIVE was not declared in this scope.

I copied the sketch again and compile it and get.

Serial_LCD_030616a:20: error: ‘POSITIVE’ was not declared in this scope
‘POSITIVE’ was not declared in this scope

I’m new to Arduino programing, don’t understand how libraries work.

I played around with the Basic Stamp before.

I'm using Arduino 1.6.5

Was using 1.6.7 but nothing would work and was told to back down to 1.6.5

I'm new to Arduino programing, don't understand how libraries work.

You must not have the library installed correctly. Like I said, the sketch with the changes I made compiles.

The situation with the LiquidCrystal_I2C library requires that only one version of the library be installed. There are two places where libraries are installed. There are libraries which come packaged with the IDE, and they are found where the program is installed. Make sure there is no LiquidCrystal library in that folder. You can put it in another folder outside of the libraries folder if you want to hang on to it.

The F.Malpartida library should be in the user libraries, which is a libraries folder of user added libraries in the same location as your sketches are stored.

If you don't actually have that library, you can follow the proceedure given in the link I posted earlier.

I downloaded the Sketch for "YwRobot Arduino LCM1602 IIC V1" which I have from.

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

Reinstalled Arduino 1.6.5 even tried Arduino 1.6.7

And this is what I get, I tried 2 different UNO boards

Serial_LCD_030616a:21: error: 'POSITIVE' was not declared in this scope

'POSITIVE' was not declared in this scope

Nothing works, what am I doing wrong?

I downloaded the sketch again from

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

and didn't change anything.

Reinstalled Arduino 1.6.7 and that didn't work, went back to Ardunio 1.6.5 and that didn't work.

Even tried a different computer.

I get this error still.

sketch_mar07a:20: error: 'POSITIVE' was not declared in this scope 'POSITIVE' was not declared in this scope

How can I declare POSITIVE.

I tried two different UNO boards and still nothing.

What am I doing wrong?

What am I doing wrong?

I do not think that you have the F.Malpartida library loaded correctly.

Remove or place in folders which are not in the two library locations all other libraries called LiquidCrystal.

Go to https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads and download NewLiquidCrystal_1.3.4.zip

In the IDE, go to Sketch>include library>Add zip library. Find the file you just downloaded and add it. Close and Reopen the IDE. You shouled see NewLiquidCrystal available in the sketch>include library>contributed libraries.

I installed the F.Malpartida library but it put it in the Users/K1PL/MyDocuments/Arduino/libraries

directory not where the libraries were installed when I installed Arduino 1.6.5. Should I rename it .

It's "fmalpartida-new-liquidcrystal-bb6d545c00c3" and move it to the other libraries.