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

Improvement to 4x20 LCD display #54

Closed
wants to merge 4 commits into from
Closed

Conversation

mikerjuk
Copy link

Many people have noticed that the 4x20 LCD display flickers and produces washed out, blurred text when values are changing quickly. This change significantly improves display quality by removing the flicker, though fast changing value are still a little blurry simply due to the slow update speed of these displays.

The cause of the flicker this the lcd.clear() command which is being issued on every loop iteration, so the entire display is cleared and then re-drawn. With the slow update speed of the LCD this results in flicker. The clear command is quite slow (~1.5ms) so removing this also benefits LCD update execution time. This time is further reduced by using a simple state machine to update only one parameter per loop iteration.

The state machine approach has not been applied to the OLED code (since I don't have one to test) but would be simple to do so and would decrease the execution time.

Removed clear() command for the 4x20 LCD, this is slow and causes a flickering and blurred digits.  To reduce  the execution time of the updateDisplay() function the display the static text is drawn only once and only one parameter is updated per loop.  The SSD1306 code remains unchanged.
Trailing 'g' was left when angle went from 360 to 0.
@kachurovskiy
Copy link
Owner

Wow, this is the first PR of this size and quality for NanoEls, huge thanks for taking time! It's incredibly welcome and I've seen the flickering myself as well. Please let me know if you got the time to work with me on the review comments. I will only be able to merge this once I test it and that could take a month (sorry, I'm alone with 2 kids now) as I don't have the required hardware in order.

@mikerjuk
Copy link
Author

I will be able to help with the comments, though need to complete the ELS install on my lathe to get some more testing it, it's all held together with duct tape and hope!

@shababnet
Copy link

Thanks kachurovskiy for the tremendous effort.
Thanks mikerjuk for the important edit. The first thing I was planning to modify was once I tried the code and found you did.
I will review the modification and test it and contribute with you to the development

@kachurovskiy
Copy link
Owner

Closing this since the mainline source code has changed a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants