diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2013-04-28 01:33:32 +0800 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2013-04-28 01:33:32 +0800 |
commit | 2e2defb19785dea4362b11f5b311e42605450fd0 (patch) | |
tree | 899a3dd1b188bf9fe167d6e25f2b5f9e2c34c1d7 /obdlogger | |
parent | 57e9ae4ccce0a3e0e29a19a0f086c767a30f3e4e (diff) | |
download | 2021-arduino-obd-2e2defb19785dea4362b11f5b311e42605450fd0.tar.gz 2021-arduino-obd-2e2defb19785dea4362b11f5b311e42605450fd0.tar.bz2 2021-arduino-obd-2e2defb19785dea4362b11f5b311e42605450fd0.zip |
update MultiLCD library
Diffstat (limited to 'obdlogger')
-rw-r--r-- | obdlogger/MultiLCD.cpp | 4 | ||||
-rw-r--r-- | obdlogger/MultiLCD.h | 6 | ||||
-rw-r--r-- | obdlogger/PCD8544.h | 5 |
3 files changed, 13 insertions, 2 deletions
diff --git a/obdlogger/MultiLCD.cpp b/obdlogger/MultiLCD.cpp index c611b14..cff82c2 100644 --- a/obdlogger/MultiLCD.cpp +++ b/obdlogger/MultiLCD.cpp @@ -121,7 +121,7 @@ void LCD_OLED::write(char c) m_column += 8; if (m_column >= 128) { m_column = 0; - m_line++; + m_line += 2; } } @@ -147,7 +147,7 @@ void LCD_OLED::printLarge(const char* s) m_column += 16; if (m_column >= 128) { m_column = 0; - m_line++; + m_line += 2; } s++; } diff --git a/obdlogger/MultiLCD.h b/obdlogger/MultiLCD.h index b8adfeb..5a8f7e3 100644 --- a/obdlogger/MultiLCD.h +++ b/obdlogger/MultiLCD.h @@ -9,6 +9,7 @@ public: virtual void backlight(bool on) {} virtual byte getLines() = 0; virtual byte getCols() = 0; + virtual void changeLine() {} }; class LCD_PCD8544 : public LCD_Common, public PCD8544 @@ -43,6 +44,11 @@ public: m_column = column << 3; m_line = line << 1; } + void changeLine() + { + m_column = 0; + m_line += 2; + } void write(char c); void print(const char* s); void printLarge(const char* s); diff --git a/obdlogger/PCD8544.h b/obdlogger/PCD8544.h index 927ec47..c6e8d43 100644 --- a/obdlogger/PCD8544.h +++ b/obdlogger/PCD8544.h @@ -88,6 +88,11 @@ class PCD8544: public Print { // Draw a chart element at the current cursor position... void drawColumn(unsigned char lines, unsigned char value); + void changeLine() + { + column = 0; + line ++; + } protected: // Current cursor position... unsigned char column; |