diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2013-06-10 13:21:09 +0800 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2013-06-10 13:21:09 +0800 |
commit | 47c6ff979fea8051c02fb38fe99c0021880a4ed8 (patch) | |
tree | e8ff3fc5e616e4b0a26faba64c904d7d18c75037 /libraries/MultiLCD/PCD8544.h | |
parent | f6082dee6e41054bec5b8d97e848517cbebbb3ad (diff) | |
download | 2021-arduino-obd-47c6ff979fea8051c02fb38fe99c0021880a4ed8.tar.gz 2021-arduino-obd-47c6ff979fea8051c02fb38fe99c0021880a4ed8.tar.bz2 2021-arduino-obd-47c6ff979fea8051c02fb38fe99c0021880a4ed8.zip |
update MultiLCD library
Diffstat (limited to 'libraries/MultiLCD/PCD8544.h')
-rw-r--r-- | libraries/MultiLCD/PCD8544.h | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/libraries/MultiLCD/PCD8544.h b/libraries/MultiLCD/PCD8544.h index c6e8d43..c96bc7e 100644 --- a/libraries/MultiLCD/PCD8544.h +++ b/libraries/MultiLCD/PCD8544.h @@ -33,11 +33,15 @@ #include <Arduino.h> #endif - // Chip variants supported... #define CHIP_PCD8544 0 #define CHIP_ST7576 1 +#define PCD8544_WIDTH 84 +#define PCD8544_HEIGHT 48 + +#define PCD8544_CMD LOW +#define PCD8544_DATA HIGH class PCD8544: public Print { public: @@ -49,7 +53,7 @@ class PCD8544: public Print { unsigned char sce = 5); /* enable (display pin 5) */ // Display initialization (dimensions in pixels)... - void begin(unsigned char width=84, unsigned char height=48, unsigned char model=CHIP_PCD8544); + void begin(unsigned char model=CHIP_PCD8544); void stop(); // Erase everything on the display... @@ -82,21 +86,18 @@ class PCD8544: public Print { virtual size_t write(uint8_t chr); #endif - // Draw a bitmap at the current cursor position... - void drawBitmap(const unsigned char *data, unsigned char columns, unsigned char lines); - // Draw a chart element at the current cursor position... void drawColumn(unsigned char lines, unsigned char value); - void changeLine() - { - column = 0; - line ++; - } + void draw8x8(const unsigned char *data); + void draw16x16(const unsigned char *data); + protected: // Current cursor position... unsigned char column; unsigned char line; + // Send a command or data to the display... + void send(unsigned char type, unsigned char data); private: unsigned char pin_sclk; @@ -105,16 +106,8 @@ class PCD8544: public Print { unsigned char pin_reset; unsigned char pin_sce; - // The size of the display, in pixels... - unsigned char width; - unsigned char height; - - // User-defined glyphs (below the ASCII space character)... const unsigned char *custom[' ']; - - // Send a command or data to the display... - void send(unsigned char type, unsigned char data); }; |