dbrgn / RPLCD

A Raspberry Pi LCD library for the widely used Hitachi HD44780 controller, written in Python. GPIO (parallel) and I²C modes supported.
https://rplcd.readthedocs.io/en/latest/
MIT License
262 stars 72 forks source link

Added a legacy mode. #91

Closed lcfyi closed 5 years ago

lcfyi commented 5 years ago

Older LCDs (or LCDs that are based off the HD44870) aren't all made equal.

It appears that some don't run at the reference clock, and as such, they're in a busy state far more often than newer or better ones, which means that, occasionally, subsequent sends are missed.

I based this off of Adafruit's older library, which included a flat 1 millisecond delay on every send event. From my testing, about 0.5 milliseconds is enough to prevent the issue, but I erred on the higher side at 0.7 milliseconds here.

From my testing, this fixes #70 which seems to plague only some users on specific hardware.

dbrgn commented 5 years ago

Thanks a lot for this! I'll review in the coming week. If I forget, remind me! :slightly_smiling_face:

thijstriemstra commented 5 years ago

I;m not such a fan of the name 'legacy mode'. It implies you use the software in old-skool way, not the device itself. it's like you introduce new code and call it legacy. Not sure what else to suggest though..

lcfyi commented 5 years ago

I;m not such a fan of the name 'legacy mode'. It implies you use the software in old-skool way, not the device itself. it's like you introduce new code and call it legacy. Not sure what else to suggest though..

The naming comes from the fact that it's (usually) only older or slower LCDs that have this problem, so I suppose legacy doesn't reflect the problem as well as I had originally intended. Maybe compatibility mode?

dbrgn commented 5 years ago

compat_mode sounds good!

lcfyi commented 5 years ago

compat_mode sounds good!

Agreed! Would you prefer a new PR with an updated branch name, or should I just update this current one?

dbrgn commented 5 years ago

Updating this branch is fine!