Permalink
Browse files

Fixed off-by-one, so now more characters can be printed, thanks jpbot!

  • Loading branch information...
1 parent b7d3c94 commit 095d0099de559937baa909dd83676b7e94a9c8f8 @ladyada ladyada committed Mar 15, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 PCD8544.cpp
View
@@ -113,7 +113,7 @@ void PCD8544::drawstring(uint8_t x, uint8_t line, char *c) {
drawchar(x, line, c[0]);
c++;
x += 6; // 6 pixels wide
- if (x + 6 >= LCDWIDTH) {
+ if (x + 6 > LCDWIDTH) {
x = 0; // ran out of this line
line++;
}
@@ -130,7 +130,7 @@ void PCD8544::drawstring_P(uint8_t x, uint8_t line, const char *str) {
return;
drawchar(x, line, c);
x += 6; // 6 pixels wide
- if (x + 6 >= LCDWIDTH) {
+ if (x + 6 > LCDWIDTH) {
x = 0; // ran out of this line
line++;
}

0 comments on commit 095d009

Please sign in to comment.