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

Add driver for HT16K33 (8x8 matrix display). #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jose1711
Copy link
Contributor

No description provided.

Copy link
Owner

@peterhinch peterhinch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am surprised you can do anything useful with nano-gui on such a minimal display. Do you have a photo to convince me?

@peterhinch
Copy link
Owner

On further thought I think this is a useful driver but not in the context of nanogui. The display is too small to display any GUI elements.

I think you should publish it somewhere else. I like the driver concept: framebuf methods will be usable on a tiny matrix. I would improve the driver to support larger matrices up to the 16x8 limit of the chip, publish it and draw attention to it in the forum.

However I can't take this on as part of nanogui. Sorry.

@peterhinch peterhinch closed this Aug 11, 2022
@jose1711
Copy link
Contributor Author

I admit this is more a PoC than anything else but thing may improve with larger matrix displays - the largest I found backed by HT16K33 was 16x8 (https://pmdway.com/collections/monochrome-led-matrix/products/ht16k33-16x8-red-led-matrix-module) and if the bi-color mode lands in micropython.

FWIW here's a dial with the current time (09:30):
obrázok

Not really accurate but you get at least some idea about the time.

My main motivation however was a usage of custom fonts - micropython does not offer a way to load custom fonts so far while nanogui coupled with font_to_py.py is a ready-to-deploy solution.

I see the reason why you're not willing to see such a small display support in the main branch. What would be really nice though is a generic framebuffer object which nanogui could draw on and then the user would blit (or any part of it) to a real display. Would you accept PR for this?

@peterhinch
Copy link
Owner

You don't need nanogui just to display fonts. You just need the Writer class for monochrome displays (CWriter for color). See this demo.

As for your suggestion it sounds interesting. I'll think about it and get back to you.

@peterhinch peterhinch reopened this Aug 12, 2022
@peterhinch
Copy link
Owner

a generic framebuffer object which nanogui could draw on and then the user would blit (or any part of it) to a real display.

I've thought about this and I'm afraid I can't see the application. Why not just subclass FrameBuffer and write a show method which does the copying to the display? A buffer larger than the physical display could be accommodated. In this case, either approach would need a means of determining which part of the buffer was drawn.

The docs outline the subclass approach, which I'm sure you've seen to write your driver.

The benefit of this approach is that a show method is synchronised to the rest of the GUI. Unless that synchrony is maintained it is likely that there would be brief artifacts when displayed objects updated.

Ultimately I can't see what a generic driver would achieve over a simple custom one.

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.

2 participants