Blinking characters



  • I would like to display blinking characters to the Core2 UI. Any ideas on how I can do this? Is this possible with UIFlow?



  • @marcvl said in Blinking characters:

    I would like to display blinking characters to the Core2 UI. Any ideas on how I can do this? Is this possible with UIFlow?

    At first thought, you could use a recurring (periodic) timer and overwrite the same text string with the background color, then back to the font color. That should produce a blinking pattern, but I have not tested it yet.



  • If my understanding is correct, you can only have one active timer running at any given moment. The blinking is used to indicate that another timer is running, so I wouldn’t be able to start a new timer without interrupting the other one.

    Is there no custom code I could create to generate a blinking effect?



  • @marcvl

    You can have multiple timers running at the same time. I like to off-set them by an odd number of milliseconds to reduce the chance of them firing at exactly the same time, but that's up to you and how complicated or time sensitive your program is going to be. Here is an example of two timers running: one for a simple 1-second counter and the other will blink the text in 133 ms periods while the other timer is running (called from the seconds_timer). Buttons A and B will start and stop the counter.

    0_1616110478106_Screen Shot 2021-03-18 at 7.31.47 PM.png

    You could also achieve the same blinking text with the Set label0 show/hide block, instead of toggling the text color between the primary color and the background color. That worked for me as well.



  • That's great! Now, I must be going crazy... I implemented your exact code and my text doesn't blink... It blinks once when I start the timer and that's it.0_1616114581599_Screen Shot 2021-03-18 at 5.41.26 PM.png



  • And if I remove the second timer and implement blinking as part of timer 1, then it works. Which is why I originally thought you could only have 1 timer.

    0_1616115165330_Screen Shot 2021-03-18 at 5.51.43 PM.png



  • @marcvl said in Blinking characters:

    I implemented your exact code

    Not quite exact... I see your issue. You are missing one block that differs from my flow...

    0_1616115274904_Screen Shot 2021-03-18 at 7.31.47 PM.png



  • Embarrassing:). You are right. All works now. I used to put text on the screen using the print function. But doing this as a label is much better. Thanks!