Finding workable code for 20x4 LCD with backpack

I've been trying to find the proper code for subject problem, to no avail.
Sorry if I'm not using the proper protocol for fitting into the right spot in this forum, but I'm desperate. Can't get Arduino to recognize NewliquidCrystal.
Every code I find online seems to have errors in them. All advisors in the forums have different ideas on the fixes.
I repeat, I am desperate.

Can't get Arduino to recognize NewliquidCrystal.

Sounds like you have not got the library installed correctly.
Post the code using the code tags given by the </> icon and also post the error message you get in a similar way.

This is one of the codes I used. It uploaded, but I had no backlite nor display on the LCD.

/* Demonstration sketch for PCF8574T I2C LCD Backpack 
Uses library from https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads GNU General Public License, version 3 (GPL-3.0) */
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C  lcd(0x27,2,1,0,4,5,6,7); // 0x27 is the I2C bus address for an unmodified backpack

void setup()
{
  // activate LCD module
  lcd.begin (16,2); // for 16 x 2 LCD module
  lcd.setBacklightPin(3,POSITIVE);
  lcd.setBacklight(HIGH);
}

void loop()
{
  lcd.home (); // set cursor to 0,0
  lcd.print(" tronixlabs.com"); 
  lcd.setCursor (0,1);        // go to start of 2nd line
  lcd.print(millis());
  delay(1000);
  lcd.setBacklight(LOW);      // Backlight off
  delay(250);
  lcd.setBacklight(HIGH);     // Backlight on
  delay(1000);
//}void setup() {
  // put your setup code here, to run once:

}

//void loop() {
  // put your main code here, to run repeatedly:

//}

I have downloaded the NewliquidCrystal library, but have not "renamed" the existing LiquidCrystal library because I don't understand the process.
Don't have an error message on the above failed code, because it downloaded satisfactorily.

Don't have an error message on the above failed code, because it downloaded satisfactorily.

But you said:-

Every code I find online seems to have errors in them.

Did you mean to say that the codes that you find fail to function in the way you expect? That is not the same thing as the code having errors.

lcd.setBacklightPin(3,POSITIVE);

So have you connected your LCD backlight input to the Arduino pin 3?
Have you got pull up resistors on the I2C lines? Are you using A4 and A5 as I2C lines and not D4 & D5?

Post your schematic ( not fritzing please ) and a photograph of your wiring.

I have a 4-wire connection from backpack to Arduino Nano, so don't need resistors (I think) and the backlight is connected through the serial line.
How do I post the photo?
The schematic is simple to see from the photo, if I learn how to post it.

How do I post the photo?

image guide

and the backlight is connected through the serial line.

Not according to that sketch you posted it isn't.

Now you don't know how to drive this forum so read this How to use this forum

We need to see a link to what you have and a schematic so we can see how you think you wired it up.

These things work and you are most probably doing things wrong. If you want us to help you find out what this is then please cooperate.

I'm sorry to be so dense about communicating with you, but working in a forum is quite strange to me. I hope the photo I am trying to submit is posted properly. If not, I'll try again.Thanks for your patience and advice.

DSCN0490[1].JPG

I'm sorry to be so dense about communicating with you, but working in a forum is quite strange to me. I hope the photo I am trying to submit is posted properly. If not, I'll try again.Thanks for your patience and advice.

DSCN0490[1].JPG

From the backpack to Nano:

GND..........GND
VCC..........5V
SDA..........A4
SCL...........A5

From that wiring I get a backlight but no text. That is the only wiring connection I know. Am I missing something on that part of my problem?

In reply #2 you said:-

but I had no backlite nor display on the LCD.

In reply #8 you say:-

From that wiring I get a backlight but no text.

So what am I supposed to believe?
Have you changed anything? If so what is it? If not when did it start working, and does it flash on an off like that code suggests or is it now on all the time?

I'm sorry to be so dense about communicating with you, but working in a forum is quite strange to me.

It is not helping that you do not answer questions asked of you. I only have these words and pictures to communicate with you, I can not see what you can see, I do not know anything you have not told me. I hope you agree with that. I am trying to find out exactly what you have done so their is a chance of spotting what is wrong.

So I ask for a link to your LCD but you don't give one. I ask for a schematic and you give me a wiring list. I ask for a photograph and their is a fuzzy picture with all the wires disappearing round the back so I can't check the connections. I send you a link about how to post an image and you only half do it. Here is your photograph:-

Okay, I appear to be uncooperative, but I truly am lost with your questions. Can we start from scratch with your suggestion of a workable sketch for me? Since I have been successful with an LCD without the backpack attached, can I leave the backpack soldered on and use the 16 pins on the LCD, or must I unsolder the backpack? I don't want to waste any more of your time with my ignorant responses. I appreciate your patience, but I can see you are getting nowhere with me.

Look their are dozens of LCD backpacks and displays, please post a link to the one you have.

This the only connection I have between the backpack and Nano:

GND..........GND
VCC..........5V
SDA..........A4
SCL...........A5

I don't know what you mean by "post a link to the one you have".

The only identification on the module I have is:

LCD display...........2004A

Backpack chip............PCF8574AT
TX0462
M00183

Is that the proper answer?

I don't know what you mean by "post a link to the one you have".

A link is the URL or web address of a web page that describes or sells the component or components you have.

Post means tell me about it in this thread.

The best way to do this is to use the icon with a chain link 12 icons in from the left hand side and paste the URL in the dialogue box that comes up.

You still have not addressed the first topic in reply #10 about your seemingly contradictory statements. This is important because it could verify the the I2C interface is working, which would be another avenue in deciding what is wrong with your system.

I acknowledge the many ways I am being contradictory.
So here is the code which has been uploaded satisfactorily and with the backlight lit, but with no text showing:

[/code[code][[code]
/*
** Example Arduino sketch for SainSmart I2C LCD2004 adapter for HD44780 LCD screens
** Readily found on eBay or http://www.sainsmart.com/ 
** The LCD2004 module appears to be identical to one marketed by YwRobot
**
** Edward Comer
** LICENSE: GNU General Public License, version 3 (GPL-3.0)
**
** sain_lcd_2.ino
** Simplified and modified by Andrew Scott for Arudino 1.0.1, Arudino Uno R3.
** NOTE: I2C pins are A4 SDA, A5 SCL
** Don't forget to use the new LiquidCrystal Library.
*/



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

#define I2C_ADDR    0x3F  // Define I2C Address where the SainSmart LCD 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(0x3F,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

void setup()
{
 lcd.begin (20,4);
 
 // Switch on the backlight
 //lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
 lcd.setBacklight(HIGH);

 // Position cursor and write some text
 lcd.home ();                   // go to the first line, first character
 lcd.print("SainSmart I2C tester");  
 lcd.setCursor ( 0, 1 );        // go to the 2nd line
 lcd.print("It's Working!");
 lcd.setCursor ( 0, 2 );        // go to the third line
 lcd.print("Sainsmarts docs suck");
 lcd.setCursor ( 0, 3 );        // go to the fourth line
 lcd.print("Nice LCD Though. ");
}

void loop()
{[code]
/*

DSCN0494[1].JPG

Sorry I think you are a troll and doing this deliberately, surly no one can be as “intelligent “as you are coming across. I will not look at this thread any more.

I'm sorry you feel that way, but I don't blame you for dropping me I'm a 91 year old, trying to learn something, but this world and its tech language are too much for me. Thanks for being patient but I guess enough is enough. (I don't know what a "troll" is.) Thanks.............

I think you mixed sda and scl wires

sda goes to a4
scl goes to a5

succes

These i2c displays can be tricky because there is no standard relationship of the pins on the chip to the pins of the lcd. Fortunately, there is a new "plug and play" library which will simplify the use of these devices.

Use the library manager to install a library called hd44780.h. If you are not using a version of the ide which suports the library manager, I suggest you update to a current ide.

You can also get it from GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library

After you have the library installed, try this sketch

#include <Wire.h>
#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h> // include i/o class header

hd44780_I2Cexp lcd; // declare lcd object: auto locate & config display for hd44780 chip

void setup()
{
  // initialize LCD with number of columns and rows:
  lcd.begin(20, 4);

  // Print a message to the LCD
  lcd.print("Hello, World!");
}

void loop()
{
  lcd.setCursor(0, 1);
  lcd.print(millis() / 1000);
  delay(1000);
}

If this does not get you going, run the diagnostic sketch in the library examples.

hd44780\examples\ioClass\hd44780_I2Cexp\I2CexpDiag

Post the results of this diagnostic test. I suggest that you start a new thread in the Display section of the forum with those results.