Scrollrichtung korrigiert

This commit is contained in:
starcalc 2018-11-29 23:06:46 +01:00
parent a1e273a248
commit 92e3e42c71
1 changed files with 9 additions and 13 deletions

View File

@ -499,8 +499,8 @@ void NeoPatterns::Text(String text, uint8_t interval)
Direction = REVERSE; Direction = REVERSE;
Color1 = 16711680; Color1 = 16711680;
textposition = 0; textposition = 0;
charposition = 8;
// charposition = 0; // charposition = 0;
charposition = 0;
} }
void NeoPatterns::TextUpdate() void NeoPatterns::TextUpdate()
@ -560,13 +560,9 @@ void NeoPatterns::TextUpdate()
// if (charx > charposition) { // if (charx > charposition) {
// x > 8-charposition // x > 8-charposition
if (8-x>charposition) { if (8-x>charposition) {
// Display the first character // Display the second character
uint64_t mask = 1LL << (uint64_t)charxyToPos(charposition+x, y); uint64_t mask = 1LL << (uint64_t)charxyToPos(charposition+x, y);
Serial.print("."); if ( (font[FontCharNext]&mask) == 0) {
Serial.print(charposition+x);
Serial.print("=");
Serial.print(charxyToPos(charposition+x, y));
if ( (font[FontChar]&mask) == 0) {
setPixelColor(currentpos, Color(0, 0, 100)); //bit is 0 at pos i setPixelColor(currentpos, Color(0, 0, 100)); //bit is 0 at pos i
} else { } else {
uint8_t _r = (uint8_t)(Color1 >> 16); uint8_t _r = (uint8_t)(Color1 >> 16);
@ -575,9 +571,9 @@ void NeoPatterns::TextUpdate()
setPixelColor(currentpos, Color(_r, _g, _b)); //bit is 1 at pos i setPixelColor(currentpos, Color(_r, _g, _b)); //bit is 1 at pos i
} }
} else { } else {
// Display the second character // Display the first character
uint64_t mask = 1LL << (uint64_t)charxyToPos(charposition+x-9, y); uint64_t mask = 1LL << (uint64_t)charxyToPos(charposition+x-8, y);
if ( (font[FontCharNext]&mask) == 0) { if ( (font[FontChar]&mask) == 0) {
setPixelColor(currentpos, Color(0, 100, 0)); //bit is 0 at pos i setPixelColor(currentpos, Color(0, 100, 0)); //bit is 0 at pos i
} else { } else {
uint8_t _r = (uint8_t)(Color1 >> 16); uint8_t _r = (uint8_t)(Color1 >> 16);
@ -625,10 +621,10 @@ void NeoPatterns::TextUpdate()
show(); show();
charposition++; charposition--;
if (charposition == 9) if (charposition == 0)
{ {
charposition = 0; charposition = 8;
textposition++; textposition++;
} }
Increment(); Increment();