I'm coming up with a problem that i haven't been able to figure out for a few days now. Basically, when i connect my screen with the 4 connections with 5v, ground, a5 and a4 I can get it working using Wire.h . however, i haven't been able to use any of the Liquid crystal library's because when I send some code it just comes up with no back light and a flashing cursor but nothing else. Ive tried tweaking other peoples codes multiple times with every combination even using my screens 0x63 address and altering display to 20x4 from the default 16x2. All i'm trying to do at this stage is get some text on the screen using Liquid crystal for when I move on but i'm having no luck. can someone please let me know where i'm going wrong.
-Thanks
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.
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, 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. It would also help if you post photos of the display and the display wiring.
Code i'm using at the minute (Example from a website)
/* www.electronicsprojectshub.com */
/Import following Libraries/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
//I2C pins declaration
LiquidCrystal_I2C lcd(0x63,20,4);
void setup()
{
lcd.begin(20,4);//Initializing display
lcd.backlight();//To Power ON the back light
//lcd.backlight();// To Power OFF the back light
}
void loop()
{
//Write your code
lcd.setCursor(0,1); //Defining positon to write from first row,first column .
lcd.print(" Tech Maker "); //You can write 16 Characters per line .
delay(1000);//Delay used to give a dynamic effect
lcd.setCursor(0,1); //Defining positon to write from second row,first column .
lcd.print("Like | Share");
delay(8000);
lcd.clear();//Clean the screen
lcd.setCursor(0,2);
lcd.print(" SUBSCRIBE ");
lcd.setCursor(0,3);
lcd.print(" TECH MAKER ");
delay(8000);
}
Ive just tried what you suggested but still having no luck
The address is definitely 0x63 I've ran multiple scanners.
I Googled your LCD and found this device
And this example:
#include <Wire.h>
#define LCD05 0x63 // LCD05 address
byte buffer[3];
char stringBuf[24];
void setup()
{
delay(100); // Delay to wait for everything to power up
Wire.begin();
buffer[0] = 0; // Clear the screen
buffer[1] = 12;
Wire.beginTransmission(LCD05);
Wire.write(buffer,2);
Wire.endTransmission();
String message = " LCD05 Test!"; // The message to be put on the screen
int len = message.length() + 1; // Length of the message
message.toCharArray(stringBuf, len); // Convert the message to a car array
stringBuf[0] = 0; // First byte of message to 0 (LCD05 command register)
Wire.beginTransmission(LCD05);
Wire.write(stringBuf, len);
Wire.endTransmission();
}
void loop()
{
}
So it is not a "PCF8574-style backpack". It is an I2C device that you simply blit bytes to.
Control functions are performed depending on the "first byte".
There is an explanation here
It looks pretty simple.
However, it would be more convenient if it obeyed the regular LiquidCrystal methods.
Hey-ho. I suspect that someone might have already written a "library"
David.
I have had it working with that code however the main reason why i wanted to use liquid crystal is because it looks much easier to program and i'm far from being an expert in this field as it is lol. I've been looking everywhere online trying to teach myself how to use it but everyone seems to be using liquid crystal. I've managed to locate the text where i want it on the screen however, when i try and put two messages on the same screen on different lines it seems to have a paddy and stop working all together and deletes half of the text.
Google "Daventech I2C LCD05 library" finds this conversation
The punters seem to be happy with registering.
Why not try it for yourself?
My Anti-Virus does not trust it.
David.