Example of 20x4 LCD with I2C that works?

Well, I just took a vacation from Arduino programming for health reasons, and before everything worked fine, tried again, and many things don't work anymore. The I2C LCD libraries are not working, and I have deleted and installed every library for the displays, and nothing works now. To the point that I burned two Arduinos and having tried everything, now I am really disappointed. Anyone can explain very clearly how to install a working library and where to get the best display drivers for LCD I2C ? This has me very sad. I know I had success before, but new versions of Arduino and many libraries is discouraging. I suspect this is a very difficult Arduino issue, when I see that almost every kit for newbies don't include the part. Please help.
WELL, I FINALLY SOLVED! After much verification, almost to become mad, I used a ohmmeter to check the cables and the cables that went to the pins A4 and A5 were open, so, the sketch would never could work. So, put new cables and the LCD is working on I2C. Just to be clear here, we must check even whatever is not logical to us. Simple cables that were open was the cause of almost me becoming mad and abandon Arduino programming.

You should start you own thread.

Hope you are feeling better now.

Did you look at these sites?

https://learn.sparkfun.com/tutorials/installing-an-arduino-library

@PedroVazquezCasta
If you purchase an lcd display with I2C backpack (any brand as far as I could test so far) the easiest way to get it working is to use
bperrybap's library which comes integrated with the latest IDE's.
There are some great features and advantages coming with thsi library as you don't have to care about the I2C address, automatic generation of the correct constructor when the complier starts etc.

Have a look at: GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library to learn a bit more what the library does for you.

"LilAbner" has not been on this forum for the last 20 months. :astonished:

oah. Sorry i didnt see the date.

Always look at the date! :sunglasses:

Always look at the date!

Sure, Sorry.

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

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

void setup()
{

lcd.begin(20,4); // initialize the lcd
lcd.clear();
lcd.home (); // go home = lcd.setCursor(0,0);
lcd.print("Hello there!");
lcd.setCurosr(0,1);
lcd.setCurosr(0,1);

And your point is?

Arduino: 1.8.9 (Windows Vista), Board: "Arduino/Genuino Uno"

C:\Users\RADIO\Documents\Arduino\sketch_apr25b\sketch_apr25b.ino: In function 'void setup()':

sketch_apr25b:15:7: error: 'class LiquidCrystal_I2C' has no member named 'setCurosr'

lcd.setCurosr(0,1);

^

sketch_apr25b:16:21: error: expected '}' at end of input

lcd.setCursor(0,1);

^

exit status 1
'class LiquidCrystal_I2C' has no member named 'setCurosr'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

And again I say - "your point is?"

I don't know what the 2 posts above are for, but I just read through the whole post and tried to figure out how someone else has had the EXACT same problem as me! I lost my LCD code and libraries when my computer fried itself. I recently looked through some old backups of the drive and found the code, which had links to libraries for the I2C! I guess I am not the only one with the problem, here is the code and the library link:
https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/

liquid_crystal_display.ino (1.02 KB)

This thread has become too confusing for anyone to follow, even those who typically provide the answers.

I suggest that anyone who is having a problem with their I2C LCD start a new thread of their own where they identify their own problem, specify what they have done so far, and indicate what kind of help they desire.

Don

KingDubDub:
I lost my LCD code and libraries when my computer fried itself.

Join the club! :grinning:

The libraries are not a problem - except that Marco_c has updated his Parola and MD_Max72xx libraries and the syntax has changed. And of course, Fmalpartida is whilst still workable, somewhat "old hat" and Bill's HD44780 library can be loaded via the IDE library manager with none of the fiddling previously required.

KingDubDub:
I recently looked through some old backups of the drive and found the code, which had links to libraries for the I2C!

Well I had some backups - but not up-to-date.

When you sense a drive failing even intermittently do not wait; backup immediately - and if SpinRite does not fix it (or has more than minor difficulties repairing it), replace it before it dies completely. :roll_eyes:

Paul__B:
When you sense a drive failing even intermittently do not wait; backup immediately

Why wait? Backups are a normal part of taking of your data. Something that needs to be done constantly like brushing your teeth.
I backup every week and then every couple of weeks, I store a copy of in a safety deposit box for off site storage.
But I have more than 4M files and 2M emails spanning over 35 years which is about 1.6 TB of data that is very important to me.

I worked on disk drives and did controller f/w and OS drivers for 10 years in the late 80's and 90s ,- cool stuff. Controllers for the original Sun & SGI computers, Cray super computers, and one controller was on the space shuttle.
but in 35 years of being around hard disks I've only ever had 2 personal drives ever go bad.
Both were thermal issues. One of the biggest causes of drive failure that I've seen (for mechanical drives) is moving them while they are spinning. I always shudder when I see people moving around laptops that are on. While many have SSDs now, for those with a mechanical drive, any movement, especially when not parallel to the plane of platter rotation, can quickly damage a drive. Yeah lots of them now park the heads, and even have motion/movement sensors in them to lift and park the heads, but that only reduces the probability of an issue, it does not eliminate it.

--- bill

1 Like
lcd.setCurosr(0,1);

on what planet is Curosr a word, and what does it mean on that planet?

bperrybap:
Why wait? Backups are a normal part of taking of your data. Something that needs to be done constantly like brushing your teeth.
I backup every week and then every couple of weeks, I store a copy of in a safety deposit box for off site storage.

Yes, of course you do. On each of your 15 computers! :roll_eyes:

Planet Dyslexius?

Looked like a simple accidental typo to me.

--- bill

LilAbner:
Well, the frustration is reaching the boiling point.

I'd like to find an example of an Arduino sketch (for Arduino UNO) that writes "Hello, world" to a 20x4 LCD display that has an I2C interface to the Arduino.

It'd be nice if you could include where to find the particular LiquidCrystal_I2C.h libraries you used to make it work.

I've also found out the hard way that LiquidCrystal_I2C.h calls for the LCD.h library. Where can I get the one that works with your example?

Sorry for the vague questions. But I keep loading LiquidCrystal_I2C.h files from various places, only to get messages like "candidate expected four arguments, but was provided eight" etc. Clearly there are many different versions of LiquidCrystal_I2C.h around, all with the same name. This might also be true of LCD.h.

It would be nice to start with a set of libraries that definitely work. I can change the wire numbers, no doubt my I2C interface is wired to my Arduino differently from yours.

But if I can just get something that compiles without errors, that would be a HUGE step forward.

Thanx all!

For many a long time I had the same problem until someone directed me to a library that works. However, I insist that the library must be included in the Arduino IDE and installed with Arduino.

PedroVazquezCasta:
For many a long time I had the same problem until someone directed me to a library that works. However, I insist that the library must be included in the Arduino IDE and installed with Arduino.

And that would of course, be Bill Perry's HD44780 library. Not included by default, but installed automatically using the Library Manager. :sunglasses: