AaronLiddiment / LEDText

FastLED Flexible Text Message Class requires LEDMatrix Class
89 stars 32 forks source link

Best method to change text on button push? #26

Closed CobaltEcho closed 2 years ago

CobaltEcho commented 2 years ago

I've been trying for a couple hours to change text on a button push (I'm good with all the button part of the code). Do you know what would be the best method to do this?

I've tried adding another cLEDText ScrollingMsg2; as well as redefining stuff various ways within functions

Would it be to redefine const unsigned char TextDemo[] = { ?

Once again, appreciate all the support, you've been a great help!

AaronLiddiment commented 2 years ago

You can do it one of two ways. One is to define the unsigned char array as a global array as it is important that it is not on the stack. You can then just rewrite the data in the array when you want to change the text. The other way is to declare another const unsigned char array with a different name. Then when you want to change the text over just call the SetText call with the new array name.