xpcc
xpcc copied to clipboard
HD44780 address calculation error for some displays
Hi!
We are using a HD44780 compatible display in our project. It is a 4x16 display, marked "1604A". We found out that the current address computation is not correct for this display. The correct line addresses are: 0x00, 0x40, 0x10, 0x50. I made a quick patch to make this display work, but it breaks current functionality: https://github.com/Sh4rK/xpcc/commit/52998df0f776caf3d9e83c4a26e10f8b317c422a.
Unfortunately I don't have any other displays to test, and I have no experience with them, so I don't know how to write a generic solution that works with everything, or even if it's possible. Maybe the only way would be to take some additional parameter(s) that describe the address calculation.
Hm, in that case I would suggest wrapping the address calculation into a (stateless) function and passing that into the constructor and default it with the current implementation. That would be backwards compatible and you can add yours. Alternatively as a template argument, but that’s a bit verbose.
I think I have some hd44780 displays lying around, I’ll give this a try. The calculation may only haven been tested on dual displays /o\