#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // 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(1,0);
lcd.print("hello everyone");
lcd.setCursor(1,1);
lcd.print("CC CODE NOT WORKING");
}
void loop()
{
}
There are several libraries with the name LiquidCrystal_I2C. The are not all the same and code from 1 may not run in another. Those LiquidCrystal_I2C libraries are old and most are not maintained. The newest and best library for I2C LCD with the hd44780 controller (1602, 2004) is the hd44780 library by Bill Perry. The library is available via the IDE library manager.
Here is your code modified to use the hd447780 library. It has been successfully tested on my Uno with a 1602 LCD with I2C backpack.
#include <Wire.h>
//#include <LiquidCrystal_I2C.h>
#include <hd44780.h> // main hd44780 header
#include <hd44780ioClass/hd44780_I2Cexp.h> // i2c expander i/o class header
//LiquidCrystal_I2C lcd(0x27, 16, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display
hd44780_I2Cexp lcd; // declare lcd object: auto locate & auto config expander chip
void setup()
{
//lcd.init(); // initialize the lcd
lcd.begin(16,2);
// Print a message to the LCD.
lcd.backlight();
lcd.setCursor(1, 0);
lcd.print("hello everyone");
lcd.setCursor(1, 1);
lcd.print("CC CODE NOT WORKING");
}
void loop()
{
}
If, after loading this code, the display does not show "hello everone", try adjusting the contrast potentiometer on the I2C backpack.
For an I2C LCD display to work, the I2C address and the I2C backpack to LCD pin mapping must be correct. If the library default settings for either or both are not correct the LCD will not work. You can try to figure out the right pin mapping and use an I2C scanner to find the address, but if you install and use the hd44780 library that is done automatically by the library.
The error shown in the improperly posted code is because of the "CUSTOM PARTS AND ENCLOSUR" that is not valid code. It did not copy with the code that you posted.
Images of code are nearly worthless. Read the forum guidelines to see how to properly post code and some good information on making a good post.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.
Please go back and fix your original post.
Please include the entire error message. It is easy to do. There is a button (lower right of the IDE window) called "copy error message". Copy the error and paste into a post in code tags. Paraphrasing the error message leaves out important information.