24 #include <MD_Parola.h>
25 #include <MD_Parola_lib.h>
27 void MD_Parola::effectWipe(
bool bLightBar,
bool bIn)
32 static int16_t nextPos = 0;
33 static int8_t posOffset = -1;
34 static uint16_t startPos = 0;
35 static uint16_t posLimit = 0;
42 PRINT_STATE(
"I WIPE");
43 posOffset = (_textAlignment ==
RIGHT ? 1 : -1);
44 startPos = nextPos = (_textAlignment ==
RIGHT ? _limitRight : _limitLeft);
45 posLimit = (_textAlignment ==
RIGHT ? _limitLeft+1 : _limitRight);
53 PRINT_STATE(
"I WIPE");
54 if (_fsmState == PAUSE)
59 FSMPRINT(
" - Clear ", nextPos);
60 FSMPRINT(
" to ", posLimit);
61 FSMPRINT(
" step ", posOffset);
62 for (uint8_t i=nextPos; i != posLimit; i += posOffset)
65 if (bLightBar && (nextPos != posLimit)) _D.setColumn(nextPos, LIGHTBAR);
68 if (nextPos == posLimit) _fsmState = PAUSE;
74 PRINT_STATE(
"I WIPE");
84 PRINT_STATE(
"O WIPE");
85 startPos = nextPos = (_textAlignment ==
RIGHT ? _limitRight : _limitLeft);
86 posLimit = (_textAlignment ==
RIGHT ? _limitLeft+1 : _limitRight);
87 posOffset = (_textAlignment ==
RIGHT ? 1 : -1);
94 PRINT_STATE(
"O WIPE");
98 FSMPRINT(
" - Clear ", nextPos);
99 FSMPRINT(
" to ", posLimit);
100 FSMPRINT(
" step ", posOffset);
101 for (uint8_t i=startPos; i != nextPos; i += posOffset)
104 if (bLightBar && (nextPos != posLimit)) _D.setColumn(nextPos, LIGHTBAR);
107 if (nextPos == posLimit) _fsmState = END;
109 nextPos += posOffset;
113 PRINT_STATE(
"O WIPE");