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 scrolling support #3

Open
marcelstoer opened this issue Jun 25, 2016 · 5 comments
Open

Add scrolling support #3

marcelstoer opened this issue Jun 25, 2016 · 5 comments

Comments

@marcelstoer
Copy link
Owner

No description provided.

@phyrexia
Copy link

Id love this feature

@steve8x8
Copy link

An idea (no code yet):

  • have a dynamic buffer of bytes storing the individual LED states => already exists, columns (check)
  • initially set buffer size to number of columns (check), expand/shrink on text write() or clear() (TBD)
  • bit (pixel/segment) operations don't change the buffer size
  • a module function to set scrolling mode (SCROLL_LEFT, SCROLL_RIGHT, perhaps SCROLL_BOUNCE; SCROLL_NONE as default) and speed
  • an asynchronous process (timer, there should be a spare one) refreshes the display, according to buffer size and scroll settings

IOW, completely decouple (public) display i/o operations and (private) display refresh. (Sounds familiar? :-))

Of course, there are heap limits lurking everywhere.

@steve8x8
Copy link

There's a bunch of commits in my fork (https://github.com/steve8x8/nodemcu-max7219), covering this issue among others (see #4). Too early for a formal merge request though.

Caveat: This makes use of the bit library, to simplify rotate and invert operations (instead of "rotate" and "invert", just have a single "rotate by n*90 deg", #10?), and to prepare for single-bit ops (issues #1 and #11) to be added to the module (to make it more similar to its Arduino counterpart at https://github.com/wayoda/LedControl).

Too bad that there's no way to keep constants off the heap (this makes #2 difficult; each font entry consumes 10 or 20 bytes).
Although I'm running a rather small integer ROM, I'm running out of memory quite often - and my use case is just a simple NTP clock, nothing really serious... Time to switch to µPython or even Arduino?

@marcelstoer
Copy link
Owner Author

marcelstoer commented Jul 14, 2017

Thanks for driving this into the right direction.

This makes use of the bit library

I can live with that.

just have a single "rotate by n*90 deg"

Sure, why not. I guess the increased processing time isn't noticeable, is it?

similar to its Arduino counterpart at https://github.com/wayoda/LedControl

My initial inspiration was https://github.com/squix78/MAX7219LedMatrix

Time to switch to µPython or even Arduino?

I'm a committer with the NodeMCU project so I won't be recommending either of course.

@ghost
Copy link

ghost commented Apr 18, 2018

PR #6 fixes #3

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

No branches or pull requests

3 participants