Yes, I'm fairly new to Arduino, with only a couple of useful projects (solar water heater controller and home security system) built.
I purchased some Yellow/green background i2c displays with black characters. PCF8574T = the i2c backpack chip. The backpack was pre-soldered to the display.
The LCDs were purchased from I2C LCD with Yellow-Green Backlight (1602) | Open ImpulseOpen Impulse
I'm using 4.7k ohm pullup resistors between the UNO's A4 (connected to SDA on the backpack) and A5 (connected to SCL on the backpack).
I've removed all other LiquidCrystal_I2C libraries I had from both "Arduino/Libraries" and "Arduino/Sketches/Libraries" (saving them in a new, NON-Arduino folder). Using the LiquidCrystal_I2C1602V1 library from openimpulse's link to "Arduino/Sketches/Libraries" (where the IDE's "Add .zip Library" function put it), I compiled and ran a small sketch, hoping that the display would work (I've actually tried 2 of the displays). I started with 0x20 for the address of the LCD (because not one of the A0, A1, A2 'jumper contacts' is soldered together). However, when I ran I2CexpDiag, I found the device's address was really 0x27. I don't understand how that can happen without the jumper connections, but then again, I can't see the underside of the backpack. Here's the whole test sketch:
#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() {
Serial.begin(9600);
Serial.println("Top of Setup");
lcd.init(); // initialize the lcd. This makes the lcd go dark (backlight off, but chars still there).
lcd.backlight(); // this DOES turn the backlight on
delay(1000);
lcd.clear(); // from here down, I don't see anything happen to the display
delay(1000);
lcd.cursor();
lcd.setCursor(0,0);
delay(1000);
lcd.blink();
delay(1000);
lcd.print("THIS IS A TEST.");
delay(1000);
lcd.setCursor(0,1);
delay(1000);
lcd.print("End Of The Test.");
delay(1000);
Serial.println("End.");
}
void loop() {
}
When the sketch is loaded to the UNO, the LCD is already lit up. Then, as the sketch ran, it turned the LCD backlight off, then on again. I have adjusted the contrast, and there is one row (the top row) of 16 black rectangles, each of which is 5 by 8 pixels. The bottom row appears completely blank.
Having problems, I ran I2CexpDiag and got this:
Serial Initialized
I2CexpDiag - i2c LCD i/o expander backpack diagnostic tool
hd44780 lib version: 0.9.3
Reported Arduino Revision: 1.8.5
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 0x27
Total I2C devices found: 1
Scanning i2c bus for all lcd displays
LCD at address: 0x27 | config: P01245673H | R/W control: Yes
Total LCD devices found: 1
LCD Display Memory Test
Display: 0
Walking 1s data test:
Compare error: addr: 0 read 22 != wrote 1
... all the rest were the same "22" value.
FAILED
No working LCD devices
Here's what I have tried:
- reversed A4 and A5. No changes.
- added the Serial.println statements to make sure I was actually executing the code. They appeared in the monitor.
- used external 4.7k pullup resistors for A4 and A5. No changes.
- before using the diagnostic, I used every address in the sketch's code between 0x20 and 0x27, since my chip is a PCF8574T, and apparently the address range for that chip is 0x20 through 0x27. No changes.
- re-soldered top and bottom of all 16 connections between the backpack and the LCD display. No changes.
- read for several hours on this forum trying to find a solution. No changes.
Here is what I question:
- the i2c diagnostic report shows A4 as digital pin 18 and A5 as digital pin 19. Yet A4 and A5 are analog pins 4 and 5. My UNO R3's digital header has only 17 positions.
- the i2c diagnostic report apparently wrote various values to different memory locations, but only read back "22". What is the significance of "22"?
- why won't something that's supposed to be so simple actually work?
I appreciate anyone who can help me get these little guys to work.