Can't program I2C LCD Display

Hello there, so I recently got my hands on an I2C LCD Display.

After looking at numerous tutorials on how to get one to work, I still can't figure out anything except for the I2C address (0x20 in this case).

The only way to get the backlight to turn on was to jump GND and pin 16 of the LCD.

Here's 2 pictures of the LCD and the I2C backpack:

I could find this display here: Crowtail- I2C LCD CT0046LCD Crowtail LCD in elecrow store.

I have used 2 different libraries / sketches and neither worked.

I connected the I2C backpack to 5V, GND, A4, A5 on an Arduino Uno, nothing worked though.

If anybody knows how to get this to work, I would appreciate it.

Q1 and R2 should switch the backlight.

Have you tried Bill Perry's diagnostic sketch? It should test the backlight.

david_prentice:
Q1 and R2 should switch the backlight.

Have you tried Bill Perry's diagnostic sketch? It should test the backlight.

Where would that sketch be?

--EDIT--

Never mind, I have found it and will rund it right now.

david_prentice:
Q1 and R2 should switch the backlight.

Have you tried Bill Perry's diagnostic sketch? It should test the backlight.

Okay well, I used the diagnostics text, but all I got out of it was the following information, and that the backlight still won't turn on, and while the test was running nothing happened either.

LCD initialized
Byte timing test
ByteXfer:285uS
cursor
Cursor Blink
setup() done
00:00:28
00:00:29
00:00:30
00:00:31
00:00:32
00:00:33
00:00:34
00:00:35
00:00:36
00:00:37
00:00:38
00:00:39
00:00:40
00:00:41
00:00:42
00:00:43
00:00:44
00:00:45
00:00:46
00:00:47
00:00:48
00:00:49
00:00:50
00:00:51
00:00:52
00:00:53
00:00:54
00:00:55
00:00:56
00:00:57
00:00:58
00:00:59
00:01:00
00:01:01
00:01:02
00:01:03
00:01:04
00:01:05
00:01:06
00:01:07
00:01:08
00:01:09
00:01:10
00:01:11
00:01:12
00:01:13
00:01:14
00:01:15
00:01:16
00:01:17
00:01:18
00:01:19
00:01:20
00:01:21
00:01:22
00:01:23
00:01:24
00:01:25
00:01:26
00:01:27
00:01:28
00:01:29
00:01:30
00:01:31
00:01:32
00:01:33
00:01:34
00:01:35
00:01:36
00:01:37
00:01:38
00:01:39
00:01:40
00:01:41
00:01:42
00:01:43
00:01:44
00:01:45
00:01:46
00:01:47
00:01:48
00:01:49
00:01:50
00:01:51
00:01:52
00:01:53
00:01:54
00:01:55
00:01:56
00:01:57
00:01:58
00:01:59
00:02:00
00:02:01
00:02:02
00:02:03
00:02:04
00:02:05
00:02:06
00:02:07
00:02:08
00:02:09
00:02:10
00:02:11
00:02:12
00:02:13
00:02:14
00:02:15
00:02:16
00:02:17
00:02:18
00:02:19
00:02:20
00:02:21
00:02:22
00:02:23
00:02:24
00:02:25
00:02:26
00:02:27
00:02:28
00:02:29
00:02:30
00:02:31
00:02:32
00:02:33
00:02:34
00:02:35
00:02:36

Now it's stuck in that loop, any advice?

I can't tell for sure what you have run but it looks like the output of the LCDlibTest sketch that is included in the hd44780 library package.
That is not the diag test for i2c backpacks.
If you haven't already I'd recommend installing the hd44780 library it is available in the IDE library manager, and you can read more about it here: duinoWitchery · GitHub
The i/o class for i2c backpacks is hd44780_I2Cexp
The diag sketch is called I2CexpDiag
Run that and see if the library correctly determines the pin mappings for that backpack.

--- bill

bperrybap:
I can't tell for sure what you have run but it looks like the output of the LCDlibTest sketch that is included in the hd44780 library package.
That is not the diag test for i2c backpacks.
If you haven't already I'd recommend installing the hd44780 library it is available in the IDE library manager, and you can read more about it here: duinoWitchery · GitHub
The i/o class for i2c backpacks is hd44780_I2Cexp
The diag sketch is called I2CexpDiag
Run that and see if the library correctly determines the pin mappings for that backpack.

--- bill

Well, I feel kind of embarrassed now, but ran the sketch and it did indeed work, the LCD might not be the best quality since one row didn't work until I pressed on the display but it turned on!

********************************************************************
Serial Initialized
--------------------------------------------------------------------
I2CexpDiag - i2c LCD i/o expander backpack diagnostic tool
--------------------------------------------------------------------
hd44780 lib version: 0.8.3
--------------------------------------------------------------------
Reported Arduino Revision: 1.6.13
CPU ARCH: AVR - F_CPU: 16000000
--------------------------------------------------------------------
 A4: digital pin: 18
 A5: digital pin: 19
SDA: digital pin: 18
SCL: digital pin: 19
--------------------------------------------------------------------
Checking for required external I2C pull-up on SDA - YES
Checking for required external I2C pull-up on SCL - YES
--------------------------------------------------------------------
Scanning i2c bus for devices..
 i2c device found at address 0x20
Total I2C devices found: 1
--------------------------------------------------------------------
Scanning i2c bus for all lcd displays
 LCD at address: 0x20 | config: M1234567H | R/W control: No
Total LCD devices found: 1
--------------------------------------------------------------------
LCD Display Memory Test
Display: 0
 (R/W control not supported)
--------------------------------------------------------------------
Each working display should be displaying its #, address, and config information
If display is blank, but backlight is on, try adjusting contrast pot
If backlight is off, wait for next test
--------------------------------------------------------------------
Blinking backlight test: to verify BL level autodetection
If backlight is mostly off but
you briefly see "BL Off" on display with backlight on,
then the library autodetected incorrect BL level
and the library cannot autoconfigure the device
--------------------------------------------------------------------
Displaying 'uptime' on all displays
--------------------------------------------------------------------

Thank you so much!

Now, how would I go and add this to a file to display my own things on the LCD?
If you could let me know that I would be forever grateful!

That backpack uses the MCP23008 i/o expander chip. Most backpacks use the PCF8574 chip.
hd44780_I2Cexp automatically figures all that out. None of the other i2c LCD backpack libraries will auto configure and work with that chip.
The chip and pin mapping are the same as the adafruit #292 backpack. Adafruit has a library, but it does not auto configure the i2c address and it is much slower than the hd44780 library.

In terms of how to use the hd44780 library, it is no different than using any other lcd library that uses the LCD 1.0 API.
All the API functions available in the hd44780 library package are in the main readme file for the library and can be seen on the main hd44780 github page.
hd44780 is a superset of the LiquidCrystal API so examples that you may see for the LiquidCrystal library will work with hd44780 once the header files and lcd object constructor are changed for hd44780 and the appropriate hd44780 i/o class.

The library includes several working example sketches with examples for each supported i/o class so you can see the needed includes and see the code for working examples.

I'd recommend updating the library to the latest revision and revisiting the github page as there have been some recent updates to the code and also some additional "readme" documentation that cane be easily viewed on the github page that has some additional explanation of the included examples.

--- bill