diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2013-04-02 16:24:09 +0800 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2013-04-02 16:24:09 +0800 |
commit | b59be2fb6f05f43e93ce70bd140ab7149fa18c40 (patch) | |
tree | 5984c4c3c8ea7618ed478ff3deece05d4045ff17 /libraries/MultiLCD/MultiLCD.h | |
parent | 509f7a67724bca9a3222a41c870da747df97f720 (diff) | |
download | 2021-arduino-obd-b59be2fb6f05f43e93ce70bd140ab7149fa18c40.tar.gz 2021-arduino-obd-b59be2fb6f05f43e93ce70bd140ab7149fa18c40.tar.bz2 2021-arduino-obd-b59be2fb6f05f43e93ce70bd140ab7149fa18c40.zip |
add MultiLCD library
Diffstat (limited to 'libraries/MultiLCD/MultiLCD.h')
-rw-r--r-- | libraries/MultiLCD/MultiLCD.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/libraries/MultiLCD/MultiLCD.h b/libraries/MultiLCD/MultiLCD.h new file mode 100644 index 0000000..2a10356 --- /dev/null +++ b/libraries/MultiLCD/MultiLCD.h @@ -0,0 +1,44 @@ +extern const PROGMEM unsigned char font16x32[][32]; +extern const PROGMEM unsigned char font5x8[][5]; + +#include "PCD8544.h" + +class LCD_PCD8544 : public PCD8544 { +public: + void printLarge(const char* s); + void backlight(bool on) + { + pinMode(7, OUTPUT); + digitalWrite(7, on ? HIGH : LOW); + } +}; + +#include "ZtLib.h" + +#define OLED_ADDRESS 0x27 + +class LCD_OLED : public ZtLib { +public: + void setCursor(unsigned char column, unsigned char line) + { + m_column = column << 3; + m_line = line << 1; + } + void write(char c); + void print(const char* s); + void printLarge(const char* s); + void clear(); + void begin(); + void backlight(bool on) {} +private: + unsigned char m_column; + unsigned char m_line; +}; + +#include "LCD4Bit_mod.h" +class LCD_1602 : public LCD4Bit_mod { +public: + void printLarge(const char* s) { print(s); } + void backlight(bool on) {} +}; + |