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

Do not busy wait in compat_mode, make the wait amount tunable #114

Closed TojikCZ closed 4 years ago

TojikCZ commented 4 years ago

Hi, so i added compat mode into the pigpio implementation and made the wait amount tune-able. The waits are not precise now, this can be improved by waiting most of the time using sleep and the rest busy waiting, but, as the amount can be now adjusted, you should be able to get the behavior you want without this trick.

The code is now duplicated, making a single wait function and fields in the lcd module may be preferable. Just ask and I'll do it.

I have another thing ready for a pull request. I made the caching optional as my setup produces too many errors for me to trust it with displaying the text right on the first try.

I have not tested the gpio implementation, but i changed only the wait method slightly with no adverse effects on the pigpio side as far as i can tell.

This is my first time trying to contribute to an open-source project, so criticize everything i do, so I'll learn something new :)

TojikCZ commented 4 years ago

oh snap, should have looked at that other pull request :/