Comments (5)
Id love this feature
from nodemcu-max7219.
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.
from nodemcu-max7219.
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?
from nodemcu-max7219.
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.
from nodemcu-max7219.
from nodemcu-max7219.
Related Issues (8)
- Allow to write arbitrary byte[] rather than table of chars
- Allow to set font table so you can write strings rather than byte[]s
- Add oscillation support
- Example code does not work: max7219.lua:70: bad argument #1 to 'ipairs' (table or rotable expected, got nil) HOT 5
- Add "rotate" parameter to setup(), extend rotation in write() HOT 1
- Addition: Set/clear/toggle individual pixels HOT 3
- Addition: Write to specific module
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodemcu-max7219.