I am trying to do what should be a very simple Arduino project using a Nano and a 1602 display and I2C adaptor. I have downloaded the LiquidCrystal library but can not get the correct syntax to make things work. I need to find out what the latest library is for the display and what code I need to put in my sketch to get it to work correctly. This is really frustrating me because it should be pretty straight forward. Please let me know if I need to include any other info.
@robotbuilder I haven't even made it far enough along to have a project to show. I can not even get a simple Hello World sketch to work right. i do not believe that the library I have, which is theoretically the latest LiquidCrystal_I2C library, works with some of the older sketches I have downloaded. I am just trying to find the right syntax to use in order to be able to print to the 1602 display. I will post one of the sketches that I found on this forum and show what errors I get.
According to the Arduino documentation ( https://docs.arduino.cc/libraries/liquidcrystal-i2c/), the library version is V1.1.2. However, according to library.properties file on github the version is 1.1.4
The library comes with example sketches that you can use to verify you have a working library installed. One of the sketches is HelloWorld. You should be able to load that sketch into the Arduino IDE and successfully compile it.
The one who has the most fun, wins!
@davemorris Not sure what is tripping you up, but here is a screen grab showing the I2C version of the LiquidCrystal library to use. You really want to use I2C as it has far fewer pins tied up, just 2 after 5VDC and Gnd. As always, after determining the best library for your use (I look for authors I know and the big names like Adafruit, Sparkfun, and Tiny) Once the library is installed you can click the ... menu to see what Examples are available. This library has the fabled 'Hello World'. In a bizarre twist, although I often say examples are never wrong, this one does have an error. See if you can spot it before compiling. Although you would normally 'get' the example yourself, in this case I will post it here for others to see. If any of you spot the error by Mark I Eyeball only, PM me.
//YWROBOT //Compatible with the Arduino IDE 1.0 //Library version:1.1 #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars and 2 line display void setup() { lcd.init(); // initialize the lcd lcd.init(); // Print a message to the LCD. lcd.backlight(); lcd.setCursor(3,0); lcd.print("Hello, world!"); lcd.setCursor(2,1); lcd.print("Ywrobot Arduino!"); lcd.setCursor(0,2); lcd.print("Arduino LCM IIC 2004"); lcd.setCursor(2,3); lcd.print("Power By Ec-yuan!"); } void loop() { }
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@tfmccarthy Hi Tim, can you post the link to the github version of the LiquidCrystal_I2C library with Ver 1.1.4 in it?
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@tfmccarthy Me again Tim, something weird going on here, here is a screen grab of the contents of my library and of the contents of the github collection you pointed out. VERY different in the details, but same examples and I suspect library. I suspect this is a case of you are better off using the Library Manager to install the library from ??? wjo knows ??? vs downloading a ZIP file from github.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
Hey Ron!
I just followed the one on the doc page: ( https://github.com/johnrickman/LiquidCrystal_I2C)
Are you gonna tell me I followed the wrong link again? If I did, I can't seem to stop myself.
ATST, version numbering and Arduino libraries aren't very reliable, IMHO.
The one who has the most fun, wins!
Try opening the library.properties on github. You should see
You should see
name=LiquidCrystal_I2C
version=1.1.4
author=Frank de Brabander...
But, as you say, the versioning is unreliable.
The one who has the most fun, wins!
@tfmccarthy davemorris They are reliable if you understand the rules. Remember where Arduino's reside.
1. Arduino is notorious for not keeping documentation up to date. I ALWAYS check the source code.
2. Github has what I consider bad operating modes.
Here are some more screen grabs from the gihub enry you tracked down. That repository is no longer used/valid as it has been moved into wherever Arduino keeps the 'Official Libraries'.
Note to Dave - read back through a few posts to get an idea what is happening, if you are still confused give me a shout.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@tfmccarthy 404 error on that link.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@tfmccarthy Your link is for rickman, but you are showing the correct Brabander author. BUT his github is 12 years old and does not have a library.properties file.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@tfmccarthy Did you notice the link at the bottom of the github page you found? Also did you notice the library.properties is for a different author than the author of the github page?
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
I get like 7 github repositories for this with a number of them archived. I just followed the one from the docs link.
The one who has the most fun, wins!
@tfmccarthy Understood. Maybe now you understand not to believe Arduino docs. But I must say I am concerned about your extreme lack of observing skills. LOL
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.