Antoon
Posts: 4
Joined: Sat Sep 21, 2019 5:37 pm

20x4 LCD display with buttons From Joy-IT

Sun Nov 17, 2019 11:02 am

Image

Hi there I'm trying to setup a display on my Pi.
The display that i've got is a RB-LCD 20x4-V2 from Joy-IT.
It runs when i use their little test program.
Looks like:

Code: Select all

from Adafruit_CharLCD import Adafruit_CharLCD import Adafruit_GPIO.PCF8574 as PCF 
 
GPIO = PCF.PCF8574(address=0x27) 
 
GPIO.setup(5,0) GPIO.output(5,0) 
 
# Define PCF pins connected to the LCD. lcd_rs        = 4 lcd_en        = 7 d4,d5,d6,d7   = 0,1,2,3 cols,lines    = 20,4 
 
# Instantiate LCD Display lcd = Adafruit_CharLCD(lcd_rs, lcd_en, d4, d5, d6, d7,cols, lines, gpio=GPIO) lcd.clear() 
 
lcd.message('xx RB-LCDV2 Test xx\n 1234567890\n abcdefgh \n 0987654321') 
This puts lcd.message('xx RB-LCDV2 Test xx\n 1234567890\n abcdefgh \n 0987654321') 20 chars in 4 rows on the display.
But then when it is a clock or so you have to write the hole dislay. THat starts to blink then.

I know you can write each character seperatly in the display. The only thing is that with this i can write only the display one time at once.

Are there more commands and where can i find a link or a manual for it...
Figuring out what these do.
I tryed different little programs but they all don't work. :(

User avatar
DougieLawson
Posts: 37095
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: 20x4 LCD display with buttons From Joy-IT

Sun Nov 17, 2019 11:09 am

HD44780 LCDs tend to flicker if you drive them to fast. You need to pause between each character to allow the onboard logic to process the data it's just received.

There's timing info in the datasheet https://www.sparkfun.com/datasheets/LCD/HD44780.pdf
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Antoon
Posts: 4
Joined: Sat Sep 21, 2019 5:37 pm

Re: 20x4 LCD display with buttons From Joy-IT

Thu Nov 21, 2019 8:05 pm

:D That is something that i can understand. What i looking for is the intruction for how to drive this display.
I can find a lot of stuff. But none off them will work.
Are there some instrucktions somewhere to help.?

Tanks...

judu82
Posts: 5
Joined: Tue Feb 13, 2018 1:36 pm

Re: 20x4 LCD display with buttons From Joy-IT

Sat Jan 11, 2020 11:19 pm

Yes no documents, i search address of the button pin for this models ?
But I find no info.

A little help :

Code: Select all

#!/usr/bin/python

# Example using a character LCD connected to a Raspberry Pi.
import time
import Adafruit_GPIO.PCF8574 as PCF # IMPORT PCF8574
import Adafruit_CharLCD as LCD # IMPORT CHARLCD

GPIO = PCF.PCF8574(address=0x27) #GPIO adress
GPIO.setup(5,0)  # I don't understand this command, if someone can explain ?
GPIO.output(5,0) # I don't understand this command, if someone can explain ?

# Raspberry Pi pin configuration:
lcd_rs        = 4  
lcd_en        = 7
lcd_d4        = 0
lcd_d5        = 1
lcd_d6        = 2
lcd_d7        = 3

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

 Define LCD column and row size for 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, gpio=GPIO)

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

# Wait 5 seconds
time.sleep(5.0)

# Demo showing the cursor.
lcd.clear()
lcd.show_cursor(True)
lcd.message('Show cursor')

time.sleep(5.0)

# Demo showing the blinking cursor.
lcd.clear()
lcd.blink(True)
lcd.message('Blink cursor')

time.sleep(5.0)

# Stop blinking and showing cursor.
lcd.show_cursor(False)
lcd.blink(False)

# Demo scrolling message right/left.
lcd.clear()
message = 'Scroll'
lcd.message(message)
for i in range(lcd_columns-len(message)):
    time.sleep(0.5)
    lcd.move_right()
for i in range(lcd_columns-len(message)):
    time.sleep(0.5)
    lcd.move_left()

# Demo turning backlight off and on.
lcd.clear()
lcd.message('Flash backlight\nin 5 seconds...')
time.sleep(5.0)
# Turn backlight off.
lcd.set_backlight(0)
time.sleep(2.0)
# Change message.
lcd.clear()
lcd.message('Goodbye!')
# Turn backlight on.
lcd.set_backlight(1)

Return to “Interfacing (DSI, CSI, I2C, etc.)”