Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print hex FF not working #100

Open
riker65 opened this issue Apr 13, 2019 · 10 comments
Open

print hex FF not working #100

riker65 opened this issue Apr 13, 2019 · 10 comments
Labels

Comments

@riker65
Copy link

riker65 commented Apr 13, 2019

Hi
I want to print hex FF from charset A00: whole block
running: lcd.write_string('\xFF')

I expected the whole block to be written?

please check

or what am I doing wrong?

Thx

@dbrgn
Copy link
Owner

dbrgn commented Apr 14, 2019

With that you will only print the character at position 0xff of the A00 charset. To print the whole block you have to add every character to the string.

To show the entire character map on your LCD, you can also use the show_charmap target of the rplcd-tests script that should get installed together with the RPLCD library.

@dbrgn
Copy link
Owner

dbrgn commented Apr 14, 2019

I'll close this, feel free to leave a comment if things are still unclear.

@dbrgn dbrgn closed this as completed Apr 14, 2019
@riker65
Copy link
Author

riker65 commented Apr 14, 2019

Hi Danilo

maybe I was unclear.
I just want to print one sign. post FF in Charset A00.

But when I do
lcd.write_string('\xFF')
the sign - a single full lcd - is not printed.

How to print the hex FF?

Thanks Thomas

@dbrgn dbrgn reopened this Apr 15, 2019
@dbrgn
Copy link
Owner

dbrgn commented Apr 15, 2019

Ah, I see. Are you sure that your LCD uses the A00 charset? What character is printed instead?

Are you using Python 2 or 3?

@riker65
Copy link
Author

riker65 commented Apr 15, 2019

Hi Danilo,

come code:

lcdmode = 'i2c'
cols = 20
rows = 4
charmap = 'A00'
i2c_expander = 'PCF8574'
address = 0x27 # If you don't know what yours is, do i2cdetect -y 1
port = 1 # 0 on an older Pi
i = 0
while i < 20:
    lcd.cursor_pos = (0, 0)
    lcd.write_string('bsxFF:')
    lcd.cursor_pos = (3, i)
    sleep(0.1)
    i = i +1
    lcd.write_string('\xFF')

sleep(2)

nothing is printed.

thanks for checking

@riker65
Copy link
Author

riker65 commented Apr 15, 2019

running python 2

@dbrgn
Copy link
Owner

dbrgn commented Apr 15, 2019

Can you try lcd.write_string(u'\xFF') instead?

@riker65
Copy link
Author

riker65 commented Apr 15, 2019

Hi,
also nothing printed

@dbrgn
Copy link
Owner

dbrgn commented Apr 15, 2019

But does printing regular text work? Have you tried using the rplcd-tests script that's installed with RPLCD?

@riker65
Copy link
Author

riker65 commented Apr 15, 2019

di not try that
but regular text and custom chars are working fine

@dbrgn dbrgn added the help label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants