0

I need help with my LCD. I have a 20x4 LCD and it shows up as 20x2. The LCD address said "// Set the LCD address to 0x27 for a 16 chars and 2 line display". I changed it which says "// Set the LCD address to 0x27 for a 20 chars and 4 line display" and uploaded it, thinking it would show up as 20x4 as it should. But it didn't work:

Photo of the issue

  • it says lcd.begin(20,4) – nori Jun 20 at 8:05
  • 1
    In which way your 20x4 LCD 'shows up' as 16x2? What do you mean by that? – smajli Jun 20 at 8:22
  • @nori I suggest you to explain what you mean by "shows up", as smajli said, and moreover to add the code you are running, explaining what you expect it to do and what it actually does. Otherwise it is impossible to understand what the problem is – frarugi87 Jun 20 at 8:51
  • Hi i added a picture to my question so i hope that could give you an insight on it – nori Jun 20 at 9:53
  • Are you saying that you changed the textual content of a comment and expected the code to magically know what was required...? – Majenko Jun 20 at 9:57
3

Nori, just ignore every code that's after the //, they are just comments and the compiler will just discard them.

Look at the LCD rear, you should see your I2C chip, search google typing ["chip's code" 20x4 arduino]. You'll see which I2C address you most likely need to use. For instance, the PCF8574 has addresses fromm 0x20 to 0x27, the PCF8574A has addresses from 0x38 to 0x3F...

Without this info you are only shooting blindfolded, the 0x27 it's only the "standard" address of the most common PCF8574 module but there are plenty of modules.

Another way to find the address is to upload this code, it's an I2C scanner that will write on the serial monitor any I2C device that replies a "ping" signal.

If you find the address and still it doesn't work or if you can't find the address, check and double and triple check the wiring, especially the false contact.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.