I have a 16x2 LCD that I want to use with a pyboard and Dave Hylands' python_lcd API that can be found here:
https://github.com/dhylands/python_lcd
My LCD display is described here:
https://wiki.52pi.com/index.php?title=Z-0234
The chip on the 'backpack' of my LDC is marked as a PCF8574T. The API expects the backpack to have an I2C address between 0x20 and 0x27. When I scan the I2C address of my device, the pyboard returns [39].
I haven't found a reference for a part labeled PCF8574T. However, I found a datasheet for the PCF8754x here:
https://www.nxp.com/docs/en/data-sheet/ ... F8574A.pdf
Table 4 of the datasheet seems to match with the API expected addresses of between 0x20 and 0x27. I suspect my device is a PCF8574A or similar, since 0x39 is an expected address as shown in Table 5.
I tried changing the DEFAULT_I2C_ADDR variable to 0x39 in the module pby_i2c_lcd.py, but this change alone doesn't seem to work.
Is it straightforward to make some changes to the API to work with the LCD display that I have?
Thanks
Andy
16 x 2 LCD
Re: 16 x 2 LCD
which is 0x27, as expected ( 2 * 16 + 7 = 39)the pyboard returns [39]
-
- Posts: 20
- Joined: Sat Oct 16, 2021 3:58 pm
Re: 16 x 2 LCD
Ah, thank you, scruss. I thought the returned value was in hex. That's good news for me as far as the HW goes.
Regards
Andy
Regards
Andy
Re: 16 x 2 LCD
Perhaps the difficulty is to select the two matching files from dhylands site.
I preferred to have one file and thus put the two into one, also removed the const() definitions and found that the memory consumption in the end was much reduced.
So if you prefer this modification put lcd_i2c8574.py onto your board and then run the other file for testing. I recommend Thonny with the file sidebar activated for that.
Good luck,
Raul
I preferred to have one file and thus put the two into one, also removed the const() definitions and found that the memory consumption in the end was much reduced.
So if you prefer this modification put lcd_i2c8574.py onto your board and then run the other file for testing. I recommend Thonny with the file sidebar activated for that.
Good luck,
Raul
- Attachments
-
- lcd_i2c8574.zip
- (2.49 KiB) Downloaded 1455 times
-
- Posts: 20
- Joined: Sat Oct 16, 2021 3:58 pm
Re: 16 x 2 LCD
Thanks for sharing your modifications. This is useful to me.
Regards
Andy
Regards
Andy
Re: 16 x 2 LCD
We had it several times here in the forum: Don't forget to turn the brightness poti up (or down, I forgot). The first time I used this display it seemed to display nothing, just because I did not know that.