I have no idea how you might want the display to look so here is a simple "Hello World" sketch using an I2C enabled 16x2 LCD and the hd44780 library for I2C displays to get you started.
To install the hd44780 library. The hd44780 library is the best available for I2C LCDs. The library is available in the Library Manager. Go to Library Manager (in the IDE menus, Sketch, Include Libraries, Manage Libraries) and in the Topics dropdown choose Display and in the Filter your search box enter hd44780. Select and install the hd44780 library by Bill Perry.
The class that you want to use is the hd44780_I2Cexp class. There are examples to show how to use the library. The nice thing about the hd44780 library is that it will autodetect the I2C address and the I2C backpack to LCD pin mapping.
I have the hd44780 library installed, but I have no idea what you're saying
can you help me 1 time code so I can learn and see the differences in between serial and lcd?
Thanks
You print to the display the same as serial, you just have limited space to write to so you must plan what to write and when. Play with the example that I posted. Play with the examples that come with the hd44780 library, there are many. Look at the documentation that comes with the library, it is extensive.
I am not going to write the code for you, mostly because I have no idea what you want printed, where you want it printed or when you want it printed.
That code will not compile. Look at the example that I posted. You must include the libraries and you must create an instance of the lcd. And you have a curly bracket that closes setup so that the rest of the code is hung outside of a function.
#include <Wire.h>
#include <hd44780.h> // main hd44780 header
#include <hd44780ioClass/hd44780_I2Cexp.h> // i2c expander i/o class header
hd44780_I2Cexp lcd; // declare lcd object: auto locate & auto config expander chip
And the [] after sideA in this line is in error.
for (int i = 0; i < sizeof(sideA[]/sizeof(sideA[0]); i++)