I love using the MD_Parola library it covers almost everything but there is something else that I wanted in it and that is the pushwheel animation that is in the MD_MAX72XX library also created by the same wonderful man @marco. Is there a way to implement the same animation of the latter library in the former?
Finally got around on how to use the getGraphicObject function. I don't know if its me or something else but I really didn't find anything on how to use this function. Please refer to the link below if anyone else wanted to use this function as well, very useful.
Feature Request ? · Issue #89 · MajicDesigns/MD_Parola · GitHub
But still wasn't able to implement time display with the pushwheel animation as I wanted it to be. Can someone help me? Here is what I did.
boolean displayValue(uint16_t hours, uint16_t minutes, uint16_t seconds) {
const uint8_t DIGITS_SIZE = 8;
static struct digitData digit[DIGITS_SIZE];
const uint8_t ST_INIT = 0, ST_WAIT = 1, ST_ANIM = 2;
static uint8_t state = ST_INIT;
switch (state) {
case ST_INIT:
// Initialize the display - done once only on the first call
for (int8_t i = DIGITS_SIZE - 1; i >= 0; i--) {
if (i == 2 || i == 5) {
digit[i].oldValue = ':';
digit[i].newValue = ':'; // Initialize colon values
digit[i].charCols = matrix.getGraphicObject()->getChar(':', CHAR_COLS, digit[i].charMap);
} else {
if (i < 2) {
digit[i].oldValue = '0' + (hours / (int)pow(10, i)) % 10; // Extract hours digit values
digit[i].newValue = '0' + (hours / (int)pow(10, i)) % 10; // Initialize hours digit values
} else if (i < 5) {
digit[i].oldValue = '0' + (minutes / (int)pow(10, i - 3)) % 10; // Extract minutes digit values
digit[i].newValue = '0' + (minutes / (int)pow(10, i - 3)) % 10; // Initialize minutes digit values
} else {
digit[i].oldValue = '0' + (seconds / (int)pow(10, i - 6)) % 10; // Extract seconds digit values
digit[i].newValue = '0' + (seconds / (int)pow(10, i - 6)) % 10; // Initialize seconds digit values
}
digit[i].charCols = matrix.getGraphicObject()->getChar(digit[i].oldValue, CHAR_COLS, digit[i].charMap);
}
}
updateDisplay(DIGITS_SIZE, digit);
state = ST_WAIT;
break;
case ST_WAIT:
break;
case ST_ANIM:
updateDisplay(DIGITS_SIZE, digit); // Show the new display
break;
default:
state = 0;
}
return (state == ST_WAIT);
}
This has 2 problems that I am not able to debug.
- hours and minutes digits are interchanged but I guess that can be solved easily by just interchanging the value input to the variables but I am guessing something else is the problem.
- Next and the biggest one is that the function isn't updating the values at all. Which is sad.
Can someone help me if someone got something?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.