From 2e2defb19785dea4362b11f5b311e42605450fd0 Mon Sep 17 00:00:00 2001 From: Stanley Huang Date: Sun, 28 Apr 2013 01:33:32 +0800 Subject: update MultiLCD library --- obdlogger/MultiLCD.cpp | 4 ++-- obdlogger/MultiLCD.h | 6 ++++++ obdlogger/PCD8544.h | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'obdlogger') 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; -- cgit v1.2.3