1

I use a normal 2x16 LCD display and it already shows the black boxes along the upper row. But Adafruit_CharLCD is not working. I installed it with pip and I can import it into my Python script and use its functions without any errors, but nothing happens. I checked all connections several times and even changed the GPIO Pins used for the D4 - D7 inputs and retried it. Just nothing, there are still the black boxes. I am using a Pi 3 B and this is the script I use:

#!/usr/bin/python
import time
import Adafruit_CharLCD as LCD

# Raspberry Pi pin configuration:
lcd_rs        = 27  # Note this might need to be changed to 21 for older revision Pi's.
lcd_en        = 22
lcd_d4        = 25
lcd_d5        = 24
lcd_d6        = 23
lcd_d7        = 18
lcd_backlight = 4

# Define LCD column and row size for 16x2 LCD.
lcd_columns = 16
lcd_rows    = 2

# Alternatively specify a 20x4 LCD.
# lcd_columns = 20
# lcd_rows    = 4

# Initialize the LCD using the pins above.
lcd = LCD.Adafruit_CharLCD(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7,
                           lcd_columns, lcd_rows, lcd_backlight)

# Print a two line message
lcd.message('Hello\nworld!')

Any ideas, what I missed? Thanks for answers!

3
  • 1
    Does your screen have a pot (it may just be that your contrast is incorrect)? Commented Jan 6, 2018 at 18:53
  • Uhm yes, I found the pot and connected it (didn't use it before, thanks) but unfortunately doesn't help. When I close it, the black boxes get invisible, but still no text shown
    – mep
    Commented Jan 6, 2018 at 19:28
  • There's a shed load of videos on YT for this: youtube.com/results?search_query=adafruit+charlcd
    – Dougie
    Commented Jan 13, 2019 at 22:28

1 Answer 1

-1

I had the same issue with a newly purchased HD44780 (16X2 LCD) and a RPi. It would glow the backlight but just no text, 16 boxes that would change contrast when I spun the pot wiper (pin3 on LCD). I tried reading all that is there (well almost) to troubleshoot this. Got myself a new HD44780 but the same disappointing result. I had double checked the GPIO and before using the Adafruit library even tried wPi pin numbering (and call me stupid if you like, but I tried the physical numbering too). No success. Finally uprooted the LCD from the bread board and plugged into another. Boom! - it was working fine. So if you see the boxes and the backlight chances are mostly your LCD is not broken and neither is the Pi. All you need to check is either the soldering on the LCD (if you have done that by yourself) or a worn out bread board! I ended up wasting 48 hours , how about you ?

1
  • white boxes only mean you have the contrats set too high. Commented May 23, 2018 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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