this is a simple program to print on an i2c lcd. Though successfully compiling it is not giving any output.(The display backlight is glowing)
#include <Wire.h> //library allows you to communicate with I2C devices
#include <LiquidCrystal_I2C.h> // library allows i2c serial communication interface
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup()
{
lcd.begin(16,2); // initialize the lcd
lcd.backlight();
}
void loop()
{
lcd.setCursor(0,0);
lcd.print("Fine imposed on");
lcd.setCursor(0,1);
lcd.print("Vehicle");
delay(5000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Vehicle");
delay(5000);
lcd.clear();
}
please edit your post, select the code part and press the </> icon in the tool bar to mark it as code. It's unreadable as it stands. (also make sure you indented the code in the IDE before copying, that's done by pressing ctrlT on a PC or cmdT on a Mac)
if this is to help get people a fine, I'm not sure you'll find a lot of people willing to help
double check your LCD address, some 16x2 LCD use 0x3F instead of 0x27 for their I2C address (run an I2C scan)
i did changed from
`LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup()
{
lcd.begin(16,2); // initialize the lcd
lcd.backlight();
}`
to
LiquidCrystal_I2C lcd(0x27); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup()
{
lcd.begin(16,2); // initialize the lcd
lcd.backlight();
}
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 maintaned. The newest and absolute best library for I2C LCD with the hd44780 controller (1602, 2004) is the hd44780 library by Bill Perry.
Have you tried the contrast adjustment?
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.
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.
In the examples, there is a diagnostic sketch that will help us to help you if you still have trouble with the display. Run the diagnostic sketch and post the results.
Depending on the needs it might or might not be what you are looking for due to the licensing GPLV3 so options are good.
hd44780 is licensed under the terms of the GNU General Public License v3.0 as opposed to the more liberal licensing terms of the GNU Lesser General Public License (LGPL), MIT, modified BSD, Apache, etc..