Giter Site home page Giter Site logo

Comments (5)

phyrexia avatar phyrexia commented on June 11, 2024

Id love this feature

from nodemcu-max7219.

steve8x8 avatar steve8x8 commented on June 11, 2024

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.

steve8x8 avatar steve8x8 commented on June 11, 2024

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.

marcelstoer avatar marcelstoer commented on June 11, 2024

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.

 avatar commented on June 11, 2024

PR #6 fixes #3

from nodemcu-max7219.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.