Coder Social home page Coder Social logo

Comments (5)

MajicDesigns avatar MajicDesigns commented on July 4, 2024

Your attempt 1 is ok but it means the processor does not do anything other than print the words.

Attempt 3 is the most correct but you need to increment the index only when the animation has completed

if (P.displayAnimate())
{
  if ((i%2) == 0) strcpy(curMessage, "hello");
  else strcpy(curMessage, "world");
  i++;
  P.displayText(curMessage, Salgin, Sspeed, Spause, Seffect, Seffect);
}

You can see this technique being used in the Parola_Scrolling example.

from md_parola.

Pixelherz23 avatar Pixelherz23 commented on July 4, 2024

Thanks alot.
I am not sure if I understand it correctly why the changing of curMessage and P.displayText() has to be in the if (P.displayAnimate()){}.
Is it because otherwise the curMessage changes too quickly and the display cant keep up with it?

from md_parola.

MajicDesigns avatar MajicDesigns commented on July 4, 2024

displayAnimate() returns true when there is no animation running (ie, no started or just completed). So to change the message you wait until the animation is finished and then change the message and restart the animation.

curMessage is the memory where the message is stored. It is declared in the application and shared with the library to save RAM usage.

If you change the message while it is animating it will usually work - part of the 'old' message will be on the display and then part of the new message will be displayed after. The problems are when the new message is a lot shorter than the old and the current display point is beyond the end of the new message - the library will unpredictable things.

Please read the library documentation if you don't understand what a class method does. These are extensively documented. In the docs folder of the library, open the file index.html.

from md_parola.

Pixelherz23 avatar Pixelherz23 commented on July 4, 2024

Thanks for the help!
I am not used to C++ so much and since there are no tutorials for your library just copy and pastes of your examples, I am quite overwhelmed.

from md_parola.

MajicDesigns avatar MajicDesigns commented on July 4, 2024

FYI someone on the Arduino forum (Arduino.cc) had this as a link for a tutorial on MD_Parola
https://lastminuteengineers.com/max7219-dot-matrix-arduino-tutorial/

from md_parola.

Related Issues (20)

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.