From fe25cca198cc468ae12d9cbf320c0d273c630016 Mon Sep 17 00:00:00 2001 From: Stanley Huang Date: Mon, 24 Feb 2014 01:47:57 +0800 Subject: Update OBD logger --- obdlogger/MicroLCD.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'obdlogger/MicroLCD.h') diff --git a/obdlogger/MicroLCD.h b/obdlogger/MicroLCD.h index 1206414..6e1d455 100644 --- a/obdlogger/MicroLCD.h +++ b/obdlogger/MicroLCD.h @@ -6,7 +6,7 @@ *************************************************************************/ #if !defined(__AVR_ATmega2560__) && !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega644P__) -#define MEMORY_SAVING +//#define MEMORY_SAVING #endif typedef enum { @@ -73,3 +73,22 @@ private: byte m_col; byte m_row; }; + +class LCD_SH1106 : public LCD_Common, public Print +{ +public: + void begin(); + void setCursor(byte column, byte line); + void draw(const PROGMEM byte* buffer, byte x, byte y, byte width, byte height); + size_t write(uint8_t c); + void clear(byte x = 0, byte y = 0, byte width = 128, byte height = 64); + void clearLine(byte line); + byte getLines() { return 21; } + byte getCols() { return 8; } +private: + void WriteCommand(unsigned char ins); + void WriteData(unsigned char dat); + void writeDigit(byte n); + byte m_col; + byte m_row; +}; -- cgit v1.2.3