Skip to content

Commit 6fb9b63

Browse files
committed
Scrolling display bugfix
Had previously converted char to byte, but it needed to support negative
1 parent e207f50 commit 6fb9b63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arduino-nixie/arduino-nixie.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ unsigned long millisAtLastCheck = 0;
150150
word unoffRemain = 0; //un-off (briefly turn on tubes during full night/away shutoff) timeout counter, seconds
151151
byte displayDim = 2; //dim per display or function: 2=normal, 1=dim, 0=off
152152
byte cleanRemain = 0; //anti-cathode-poisoning clean timeout counter, increments at cleanSpeed ms (see loop()). Start at 11 to run at clock startup
153-
byte scrollRemain = 0; //"frames" of scroll – 0=not scrolling, >0=coming in, <0=going out, -128=scroll out at next change
153+
int8_t scrollRemain = 0; //"frames" of scroll – signed byte - 0=not scrolling, >0=coming in, <0=going out, -128=scroll out at next change.
154154
byte versionRemain = 3; //display version at start
155155

156156

@@ -1323,7 +1323,7 @@ void updateDisplay(){
13231323
*/
13241324
else if(scrollRemain>0) { //scrolling display: value coming in - these don't use editDisplay as we're going array to array
13251325
for(byte i=0; i<displaySize; i++) {
1326-
byte isrc = i-scrollRemain;
1326+
int8_t isrc = i-scrollRemain; //needs to support negative
13271327
displayNext[i] = (isrc<0? 15: scrollDisplay[isrc]); //allow to fade
13281328
}
13291329
}

0 commit comments

Comments
 (0)