I built a device using an Arduino MEGA 2560 and a 20x4 LCD (I2C interface). Works great, I can position the cursor to any location on the screen using the lcd.setcursor(col,row) command, then write text to that location, works exactly the way I want it to.
Then built a new chassis to do the same thing, smaller chassis, but same Arduino MEGA 2560 controller, same (or very similar) 20x4 LCD (I2C interface). The hope was that both chassies would run identically, in the LCD display and everywhere else.
First I loaded a very simple "Hello, world" test program into the new chassis. It ran perfectly and printed "Hello world" in the top line of the LCD, just as I expected it to, sharp and clear. The older (larger) chassis did the same, seems that both LCDs were working correctly. So I was confident I had the wiring correct, I2C connections correct, addresses (both 0x3F) correct in the new chassis as well as the old.
Then I transferred the operational program from the first chassis to the second (smaller) chassis, hope the two would run identically, especially in the LCD display. First LCD always ran correctly and still does. But now on the 2nd (smaller) chassis, the LCD remains blank.
I wondered why both of them run "Hello World" correctly and produce excellent results, but they act differently with the operations program. Long story short, the only difference may be that the operational program uses the lcd.setCursor(col,row) command to go to a certain place on the LCD before writing, but "Hello World" does not use that command.
Long story short, I commented out the lcd.setCursor command wherever it occurred and reloaded the operation program (without lcd.setCursor) into the new (smaller) chassis. And now the LCD in that (smaller) chassis presents all the data that's written to it! The data is often in the wrong place in the smaller chassis, since I no longer use the lcd.setCursor command there to correctly position the data. But all the letters and number come out bright, sharp and clear.
Has anybody run into a situation with these I2C 20x4 LCD displays, where some of them implement all commands (such as lcd.setCursor), but others don't?
Or do I have a broken LCD in the new (smaller) chassis? They were both parts-box items, probably of different ages, both from Sainsmart.
Anybody run into this before?