Hello World not working

Hello,

I'm relatively new to the world of coding and arduino. I have a robot set up with an LCD screen (20x4) that I'm trying to set up to say 'Hello World'. I keep getting error messages when I attempt to initialize the LCD. The following is my code and error message:
#include "LiquidCrystal.h"
#include <Wire.h>

#define I2C_ADDR 0x3F // 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

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(20, 4);
// Print a message to the LCD.
lcd.print("hello, world!");
}

void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis() / 1000);
}

Error message:
Hello_World:15:76: error: no matching function for call to 'LiquidCrystal::LiquidCrystal(int, int, int, int, int, int, int, int)'
LiquidCrystal lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

Any help would be greatly appreciated!
^

First, have a look at "How to use the forum" before you make more posts.

Next, it's a common problem with LiquidCrystal because there are a bazillion different versions of that library which are all different. Or in other words, there are a bazillion different libraries using the same name :confused:

So you have to be sure to use your version of LiquidCrystal it expects. (Look at IT'S examples instead of random internet examples which don't specify which version of LiquidCrystal.

Or use a different library like the hd44780 by Bill Perry which is more capable anyway :slight_smile:

LBLRobot:
Any help would be greatly appreciated!

LiquidCrystal.h is a header file for the IDE bundled LiquidCrystal library.
The LiquidCrystal library uses arduino pins to control the LCD.

The rest of your code appears to be intended for fm's newLiquidCrystal libary which is for device using a i2c PCF8574 based LCD backpack.

The LiquidCryscal library is the wrong library to control an LCD by an i2c backpack.

Installing and getting fm's newLiquidCrystal up and running is a bit tricky since it has to be manually installed and may require modifications depending on which IDE version and which Arduino board/core you are using.
Once installed, you then have to put the correct information into the constructor.
The i2c address can be obtained using an i2c scanner, but the other pin mapping information must match your particular backpack and if it is incorrect it will not work.

I would recommend using the hd44780 library with the hd44780_I2Cexp i/o class.
It is easy to install, and can automatically figure out all the parameters it needs for initialization.
Install it using the IDE library manager. it is quick and easy to do - and do not install it from a zip file.
Here is the github page where you can read more about it:

including instructions for how to install it using the IDE.

Once installed, you can access all the documentation through the Documentation example sketch.
First thing to do after the library in installed, is to run the included diagnostic tool I2CexpDiag to test things.
Once that works, then you can look at and run the other hd44780_I2Cexp i/o class examples to see which header files to include , how to declare your lcd object, and how to use the i/o class.

While it may seem a bit intimidating at first due to the hd44780 library having multiple i/o classes, once you look a bit closer it is very simple to use.

--- bill

Try starting with File->Examples->LiquidCrystal->HelloWorld

John
Septillion and I had assumed that an LCD with an i2c backpack was being used, given the inclusion of <Wire.h> and the sketch code.

--- bill

bperrybap:
John
Septillion and I had assumed that an LCD with an i2c backpack was being used, given the inclusion of <Wire.h> and the sketch code.
--- bill

On re-reading the code I see what you mean. Yes, they are probably using one of the many I2C backpacks and need a library that can do that. The built-in "LiquidCrystal.h" certainly can't.
OP, Please ignore my advice to study the built-in LiquidCrystal library.