Hello everyone. I'm making a project using a LED display with the MD_PAROLA lib and i'm having a little problem with the exibition of my messages.
My project is very simple, i have a sensor to check pressure. When the pessure changes, I show a message and then the value the sensor reads, and untill here, it's all ok. The problem is, when my sensor is idle, i show a placeholder message with the effect PA_SCROLL_LEFT and, sometimes, the sensor make reading while the placeholder is in the middle of the animation. So, I need to just stop the placeholder and it's animation and change the message on the display. But no matter what i try, nothing stops this animation to complete itself before change the message, and this way, sometimes, i lost my reading.
I've already tried the methods displayClear() and displayReset(), but nothing happens, the display keep show the placeholder. Can anyone help me?
void showMessage() {
if (display.displayAnimate()) {
if(reading == true) {
display.displayText("Assopre!", PA_CENTER, 0, 500, PA_PRINT, PA_PRINT);
delay(500);
}
else if (resultReady == true) {
display.displayText("FODEU!", PA_CENTER, 0, 3000, PA_PRINT, PA_PRINT);
display.displayAnimate();
delay(3000);
display.displayText(sensorValue, PA_CENTER, 100, 5000, PA_FADE, PA_FADE);
display.displayAnimate();
resultReady = false;
maxReading = 0;
}
else {
display.displayText("Barfometro ", PA_CENTER, 0, 0, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
}
display.displayAnimate();
}
}
This is the code I'm using to control the display. I know it's not pretty yet, but my objective is make it work first and then I'll adjust the repetitions.
The "else" is my placeholder.