i bought this 16*2 lcd but dont show words on it
connection:
1. Pin 1 (Ground) goes to the ground rail.
2. Pin 2 (VCC/5v) goes to the positive rail.
3. Pin 3 (V0) goes to the middle wire of the potentiometer.
4. Pin 4 (RS) goes to GPIO25 (Pin 22)
5. Pin 5 (RW) goes to the ground rail.
6. Pin 6 (EN) goes to GPIO24 (Pin 18)
7. Pin 11 (D4) goes to GPIO23 (Pin 16)
8. Pin 12 (D5) goes to GPIO17 (Pin 11)
9. Pin 13 (D6) goes to GPIO18 (Pin 12)
10. Pin 14 (D7) goes to GPIO22 (Pin 15)
11. Pin 15 (LED +) goes to the positive rail.
12. Pin 16 (LED -) goes to the ground rail.
look at this photo:
https://imgur.com/ZyAUNw6
https://imgur.com/zzJqUjc
https://imgur.com/sJe5VXZ
my python code:
Code: Select all
import time
import Adafruit_CharLCD as LCD
# Raspberry Pi pin setup
lcd_rs = 25
lcd_en = 24
lcd_d4 = 23
lcd_d5 = 17
lcd_d6 = 18
lcd_d7 = 22
lcd_backlight = 2
# Define LCD column and row size for 16x2 LCD.
lcd_columns = 16
lcd_rows = 2
lcd = LCD.Adafruit_CharLCD(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7, lcd_columns, lcd_rows, lcd_backlight)
lcd.message('Hello\nworld!')
# Wait 5 seconds
time.sleep(5.0)
lcd.clear()
text = raw_input("Type Something to be displayed: ")
lcd.message(text)
# Wait 5 seconds
time.sleep(5.0)
lcd.clear()
lcd.message('Goodbye\nWorld!')
time.sleep(5.0)
lcd.clear()
