#ifndef LiquidCrystal_mx300_h #define LiquidCrystal_mx300_h #include #include "Print.h" // commands #define LCD_CLEARDISPLAY 0x01 #define LCD_RETURNHOME 0x02 #define LCD_ENTRYMODESET 0x04 #define LCD_DISPLAYCONTROL 0x08 #define LCD_CURSORSHIFT 0x10 #define LCD_FUNCTIONSET 0x20 #define LCD_SETCGRAMADDR 0x40 #define LCD_SETDDRAMADDR 0x80 // commands for some mx300 specific functions #define LCD_NORMAL 0x38 // reset orientation to normal #define LCD_MIRVERT 0x39 // mirror display vertically (without altering ram contents) #define LCD_MIRHORZ 0x3a // mirror display horizontally (without altering ram contents) #define LCD_ROTATE 0x3b // rotate display 180 degrees (without altering ram contents) // flags for display entry mode #define LCD_ENTRYRIGHT 0x00 #define LCD_ENTRYLEFT 0x02 #define LCD_ENTRYSHIFTINCREMENT 0x01 #define LCD_ENTRYSHIFTDECREMENT 0x00 // flags for display on/off control #define LCD_DISPLAYON 0x04 #define LCD_DISPLAYOFF 0x00 #define LCD_CURSORON 0x02 #define LCD_CURSOROFF 0x00 #define LCD_BLINKON 0x01 #define LCD_BLINKOFF 0x00 // flags for display/cursor shift #define LCD_DISPLAYMOVE 0x08 #define LCD_CURSORMOVE 0x00 #define LCD_MOVERIGHT 0x04 #define LCD_MOVELEFT 0x00 // flags for function set #define LCD_8BITMODE 0x10 #define LCD_4BITMODE 0x00 #define LCD_2LINE 0x08 #define LCD_1LINE 0x00 #define LCD_5x10DOTS 0x04 #define LCD_5x8DOTS 0x00 #define _mx300_bigfont1 // Set to bigfont1, bigfont1a, bigfont2 etc as desired // bigfont1 - Based on Michael Pilcher's original, but using mx300 specific chars. Lowercase & punctuation added // bigfont1a - slight variation to bigfont1 // bigfont1b - Michael Pilcher's character set with slight alterations and lowercase added // bigfont2 - Alternative blocky character set, again using mx300 specific characters #ifdef _mx300_bigfont1 // Font based on https://forum.arduino.cc/index.php?topic=8882.0 by digimike (Michael Pilcher) // but using mx300 specific characters as font elements and defining a lowercase bigfont set static uint8_t _charpixels[8][8] = { { 0x07, 0x0F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }, { 0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x1C, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }, { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x0F, 0x07 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F }, { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1E, 0x1C }, { 0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x1F }, { 0x1F, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F }, }; static const uint8_t _bigFont[96][8] = { {32,32,32,32,32,32,32,32}, {32,5,32,32,32,4,32,32}, {0,0,32,32,32,32,32,32}, {17,0,0,17,17,3,3,17}, {0,255,6,32,7,255,5,32}, {1,4,5,32,0,1,4,32}, {0,255,4,32,3,5,7,32}, {0,32,32,32,32,32,32,32}, {0,32,32,32,3,32,32,32}, {2,32,32,32,5,32,32,32}, {3,18,5,32,0,255,2,32}, {32,4,32,32,1,255,1,32}, {32,32,32,32,5,32,32,32}, {32,32,32,32,1,1,1,32}, {32,32,32,32,4,32,32,32}, {32,4,5,32,0,1,32,32}, {0,1,2,32,3,4,5,32}, {1,2,32,32,4,5,4,32}, {6,6,2,32,3,7,7,32}, {6,6,2,32,7,7,5,32}, {3,4,2,32,32,32,5,32}, {3,6,6,32,4,7,5,32}, {0,6,6,32,3,7,5,32}, {1,1,2,32,32,0,32,32}, {0,6,2,32,3,7,5,32}, {0,6,2,32,32,32,5,32}, {17,32,32,32,17,32,32,32}, {17,32,32,32,5,32,32,32}, {4,17,1,32,32,1,17,32}, {16,16,16,32,1,1,1,32}, {1,17,4,32,17,1,32,32}, {1,6,2,32,32,7,32,32}, {1,7,2,32,3,4,5,32}, {0,6,2,32,5,32,5,32}, {0,6,5,32,3,7,2,32}, {0,1,1,32,3,4,4,32}, {2,1,2,32,5,4,5,32}, {0,6,6,32,5,7,7,32}, {0,6,6,32,5,32,32,32}, {0,1,1,32,3,4,2,32}, {0,4,0,32,5,32,5,32}, {1,0,1,32,4,5,4,32}, {32,32,2,32,4,4,5,32}, {0,4,1,32,5,32,2,32}, {2,32,32,32,3,4,4,32}, {0,3,5,2,5,32,32,5}, {0,3,32,0,5,32,2,5}, {0,1,1,2,3,4,4,5}, {0,6,2,32,5,32,32,32}, {0,1,2,32,3,4,3,4}, {0,6,5,32,5,32,2,32}, {0,6,6,32,7,7,5,32}, {1,2,1,32,32,5,32,32}, {0,32,2,32,3,4,5,32}, {2,32,0,32,3,4,5,32}, {0,32,32,2,3,0,2,5}, {3,4,5,32,0,1,2,32}, {3,4,5,32,32,5,32,32}, {1,6,5,32,0,7,4,32}, {5,1,32,32,2,4,32,32}, {3,4,32,32,32,1,2,32}, {1,3,32,32,4,0,32,32}, {0,2,32,32,32,32,32,32}, {32,32,32,32,4,4,4,32}, {2,32,32,32,32,32,32,32}, {32,4,4,32,255,7,2,32}, {2,32,32,32,3,6,5,32}, {32,32,32,32,18,6,6,32}, {32,32,0,32,0,6,5,32}, {4,17,4,32,3,6,7,32}, {0,6,32,32,3,32,32,32}, {17,6,2,32,17,4,5,32}, {2,32,32,32,3,1,2,32}, {6,32,32,32,3,32,32,32}, {32,32,6,32,17,4,5,32}, {5,17,32,32,5,2,32,32}, {2,32,32,32,3,32,32,32}, {32,32,32,32,0,3,5,2}, {32,32,32,32,0,1,2,32}, {32,4,32,32,255,7,255,32}, {0,6,17,32,5,32,32,32}, {17,6,2,32,32,32,3,32}, {32,4,4,32,0,32,32,32}, {4,16,16,32,6,6,18,32}, {16,0,16,32,4,5,32,32}, {32,32,32,32,3,4,0,32}, {4,4,32,32,3,5,32,32}, {32,32,32,32,5,4,3,32}, {4,32,4,32,17,1,17,32}, {0,4,2,32,32,4,5,32}, {16,16,4,32,18,6,6,32}, {4,0,32,32,1,3,32,32}, {32,255,32,32,32,255,32,32}, {2,4,32,32,5,1,32,32}, {4,1,4,1,32,32,32,32}, {255,255,255,32,255,255,255,32} }; #endif #ifdef _mx300_bigfont1a static uint8_t _charpixels[8][8] = { { 0x07, 0x0F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }, { 0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x1C, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }, { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x0F, 0x07 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F }, { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1E, 0x1C }, { 0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x1F }, { 0x1F, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F }, }; static const uint8_t _bigFont[96][8] = { {32,32,32,32,32,32,32,32}, {32,5,32,32,32,4,32,32}, {0,0,32,32,32,32,32,32}, {17,0,0,17,17,3,3,17}, {0,0,6,32,7,5,5,32}, {1,4,5,32,0,1,4,32}, {0,255,4,32,3,5,7,32}, {0,32,32,32,32,32,32,32}, {0,32,32,32,3,32,32,32}, {2,32,32,32,5,32,32,32}, {3,18,5,32,0,255,2,32}, {32,4,32,32,1,255,1,32}, {32,32,32,32,5,32,32,32}, {32,32,32,32,1,1,1,32}, {32,32,32,32,4,32,32,32}, {32,4,5,32,0,1,32,32}, {0,1,2,32,3,4,5,32}, {1,2,32,32,4,5,4,32}, {6,6,2,32,3,7,7,32}, {6,6,2,32,7,7,5,32}, {3,4,2,32,32,32,5,32}, {3,6,6,32,4,7,5,32}, {0,6,6,32,3,7,5,32}, {1,1,2,32,32,0,32,32}, {0,6,2,32,3,7,5,32}, {0,6,2,32,32,32,5,32}, {17,32,32,32,17,32,32,32}, {17,32,32,32,5,32,32,32}, {4,4,5,32,32,1,2,32}, {16,16,16,32,1,1,1,32}, {3,4,16,32,0,1,32,32}, {6,6,17,32,6,32,32,32}, {1,7,2,32,3,4,5,32}, {0,6,2,32,5,32,5,32}, {0,6,5,32,3,7,2,32}, {0,1,1,32,3,4,4,32}, {2,1,2,32,5,4,5,32}, {0,6,6,32,5,7,7,32}, {0,6,6,32,5,32,32,32}, {0,1,1,32,3,4,2,32}, {0,4,0,32,5,1,5,32}, {1,0,1,32,4,5,4,32}, {32,32,2,32,4,4,5,32}, {0,4,1,32,5,32,2,32}, {2,32,32,32,3,4,4,32}, {0,3,5,2,5,32,32,5}, {0,3,32,0,5,32,2,5}, {0,1,1,2,3,4,4,5}, {0,6,2,32,5,32,32,32}, {0,1,2,32,3,4,3,4}, {0,6,5,32,5,32,2,32}, {0,6,6,32,7,7,5,32}, {1,2,1,32,32,5,32,32}, {0,32,2,32,3,4,5,32}, {2,32,0,32,3,4,5,32}, {0,32,32,2,3,0,2,5}, {3,4,5,32,0,1,2,32}, {3,4,5,32,32,5,32,32}, {1,6,5,32,0,7,4,32}, {5,1,32,32,2,4,32,32}, {3,4,32,32,32,1,2,32}, {1,3,32,32,4,0,32,32}, {0,2,32,32,32,32,32,32}, {32,32,32,32,4,4,4,32}, {2,32,32,32,32,32,32,32}, {32,4,4,32,255,7,2,32}, {2,32,32,32,3,6,5,32}, {32,32,32,32,18,6,6,32}, {32,32,0,32,0,6,5,32}, {4,17,4,32,3,6,7,32}, {0,6,32,32,3,32,32,32}, {17,6,2,32,17,4,5,32}, {2,32,32,32,3,1,2,32}, {6,32,32,32,3,32,32,32}, {32,6,32,32,4,5,32,32}, {5,17,32,32,5,2,32,32}, {2,32,32,32,3,32,32,32}, {32,32,32,32,0,3,5,2}, {32,32,32,32,0,1,2,32}, {32,4,32,32,255,7,255,32}, {0,6,17,32,5,32,32,32}, {17,6,2,32,32,32,3,32}, {32,4,4,32,0,32,32,32}, {4,16,16,32,6,6,18,32}, {16,0,16,32,4,5,32,32}, {32,32,32,32,3,4,0,32}, {4,4,32,32,3,5,32,32}, {32,32,32,32,5,4,3,32}, {4,32,4,32,17,1,17,32}, {0,4,2,32,32,4,5,32}, {16,16,4,32,18,6,6,32}, {4,0,32,32,1,3,32,32}, {32,255,32,32,32,255,32,32}, {2,4,32,32,5,1,32,32}, {4,1,4,1,32,32,32,32}, {255,255,255,32,255,255,255,32} }; #endif #ifdef _mx300_bigfont1b // Font based on https://www.instructables.com/id/Custom-Large-Font-For-16x2-LCDs/ by Michael Pilcher // also at http://fritzing.org/media/fritzing-repo/projects/l/lcd-1602-brightness-contras/code/dale-bigfont.ino Dale Gass // This one doesn't use mx300 specific characters so I reworked my lower case characters, some don't look so good ("e", "s", and "z") // Also shortened all Michael's characters to max 4 wide as five seemed excesssive on such a small display ("#" character needs fixing) static uint8_t _charpixels[8][8] = { { 0x07, 0x0F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }, { 0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x1C, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }, { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x0F, 0x07 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F }, { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1E, 0x1C }, { 0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x1F }, { 0x1F, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F }, }; static const uint8_t _bigFont[96][8] = { {32,32,32,32,32,32,32,32}, {255,32,32,32,7,32,32,32}, {5,5,32,32,32,32,32,32}, {4,255,4,255,1,255,1,255}, {0,255,6,32,7,255,5,32}, {1,32,4,1,4,1,32,4}, {0,6,2,32,3,7,2,4}, {5,32,32,32,32,32,32,32}, {0,1,32,32,3,4,32,32}, {1,2,32,32,4,5,32,32}, {1,4,4,1,4,1,1,4}, {4,255,4,32,1,255,1,32}, {32,32,32,32,5,32,32,32}, {4,4,4,32,32,32,32,32}, {32,32,32,32,4,32,32,32}, {32,32,4,1,4,1,32,32}, {0,1,2,32,3,4,5,32}, {1,2,32,32,32,255,32,32}, {6,6,2,32,3,7,7,32}, {6,6,2,32,7,7,5,32}, {3,4,2,32,32,32,255,32}, {255,6,6,32,7,7,5,32}, {0,6,6,32,3,7,5,32}, {1,1,2,32,32,0,32,32}, {0,6,2,32,3,7,5,32}, {0,6,2,32,32,32,255,32}, {1,32,32,32,1,32,32,32}, {1,32,32,32,5,32,32,32}, {32,4,1,32,1,1,4,32}, {4,4,4,32,1,1,1,32}, {1,4,32,32,4,1,1,32}, {1,6,2,32,32,7,32,32}, {0,6,2,32,3,4,4,32}, {0,6,2,32,255,32,255,32}, {255,6,5,32,255,7,2,32}, {0,1,1,32,3,4,4,32}, {255,1,2,32,255,4,5,32}, {255,6,6,32,255,7,7,32}, {255,6,6,32,255,32,32,32}, {0,1,1,32,3,4,2,32}, {255,4,255,32,255,32,255,32}, {1,255,1,32,4,255,4,32}, {32,32,255,32,4,4,5,32}, {255,4,5,32,255,32,2,32}, {255,32,32,32,255,4,4,32}, {0,3,5,2,255,32,32,255}, {0,2,32,255,255,32,3,5}, {0,1,2,32,3,4,5,32}, {255,6,2,32,255,32,32,32}, {0,1,2,32,3,4,255,4}, {255,6,2,32,255,32,2,32}, {0,6,6,32,7,7,5,32}, {1,255,1,32,32,255,32,32}, {255,32,255,32,3,4,5,32}, {2,32,32,5,32,2,0,32}, {255,32,32,255,3,0,2,5}, {3,4,5,32,0,32,2,32}, {3,4,5,32,32,255,32,32}, {1,6,5,32,0,7,4,32}, {255,1,32,32,255,4,32,32}, {1,4,32,32,32,32,1,4}, {1,255,32,32,4,255,32,32}, {0,2,32,32,32,32,32,32}, {32,32,32,32,4,4,4,4}, {2,32,32,32,32,32,32,32}, {32,4,4,32,255,7,2,32}, {2,32,32,32,3,6,5,32}, {32,32,32,32,0,6,6,32}, {32,32,0,32,0,6,5,32}, {4,45,4,32,3,7,7,32}, {0,6,32,32,3,32,32,32}, {255,6,2,32,4,4,5,32}, {2,32,32,32,3,1,2,32}, {6,32,32,32,3,32,32,32}, {32,32,6,32,4,4,5,32}, {5,4,32,32,5,2,32,32}, {2,32,32,32,3,32,32,32}, {32,32,32,32,0,3,5,2}, {32,32,32,32,0,1,2,32}, {32,4,32,32,255,7,255,32}, {0,6,255,32,5,32,32,32}, {255,6,2,32,32,32,3,32}, {32,4,4,32,0,32,32,32}, {4,45,45,32,6,6,255,32}, {4,0,4,32,4,5,32,32}, {32,32,32,32,3,4,0,32}, {4,4,32,32,3,5,32,32}, {32,32,32,32,5,4,3,32}, {4,32,4,32,7,255,7,32}, {0,4,2,32,32,4,5,32}, {45,45,4,32,255,6,6,32}, {4,0,1,32,1,3,4,32}, {32,255,32,32,32,255,32,32}, {1,2,4,32,4,5,1,32}, {4,1,4,1,32,32,32,32}, {255,255,255,32,255,255,255,32} }; #endif #ifdef _mx300_bigfont2 static uint8_t _charpixels[8][8] = { { 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F }, { 0x1C, 0x1C, 0x1E, 0x0E, 0x0F, 0x07, 0x07, 0x00 }, { 0x07, 0x07, 0x0F, 0x0E, 0x1E, 0x1C, 0x1C, 0x00 }, { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }, { 0x00, 0x00, 0x1F, 0x1F, 0x00, 0x00, 0x1F, 0x1F }, { 0x00, 0x1F, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x00 }, }; static const uint8_t _bigFont[96][8] = { {32,32,32,32,32,32,32,32}, {32,5,32,32,32,17,32,32}, {4,4,32,32,32,32,32,32}, {7,5,5,7,17,5,5,17}, {18,5,0,32,16,5,18,32}, {0,2,4,32,4,0,2,32}, {17,255,32,32,255,5,1,32}, {4,32,32,32,32,32,32,32}, {4,32,32,32,3,32,32,32}, {3,32,32,32,4,32,32,32}, {3,255,4,32,4,255,3,32}, {2,5,2,32,0,255,0,32}, {32,32,32,32,4,32,32,32}, {2,2,2,32,0,0,0,32}, {32,32,32,32,17,32,32,32}, {32,2,4,32,4,32,32,32}, {18,0,18,32,255,2,255,32}, {0,5,32,32,2,5,2,32}, {0,1,18,32,5,2,2,32}, {1,1,5,32,2,2,255,32}, {18,2,5,32,32,32,5,32}, {255,1,0,32,2,2,255,32}, {18,1,0,32,255,2,255,32}, {0,0,5,32,32,5,32,32}, {18,1,18,32,255,2,255,32}, {18,1,18,32,2,2,255,32}, {17,32,32,32,17,32,32,32}, {32,17,32,32,2,17,32,32}, {16,17,0,32,32,32,0,32}, {16,16,16,32,0,0,0,32}, {0,17,16,32,0,32,32,32}, {6,6,17,32,1,32,32,32}, {7,0,18,32,18,1,255,32}, {5,1,5,32,255,32,255,32}, {5,1,18,32,255,16,255,32}, {5,0,0,32,255,16,16,32}, {5,0,18,32,255,16,255,32}, {5,1,1,32,255,16,16,32}, {5,1,1,32,255,32,32,32}, {18,0,7,32,255,16,18,32}, {5,2,5,32,255,32,255,32}, {0,5,0,32,16,255,16,32}, {0,5,0,32,16,255,32,32}, {5,16,4,32,255,32,255,32}, {5,32,32,32,255,16,16,32}, {5,18,5,32,255,32,255,32}, {5,0,18,32,255,32,255,32}, {5,0,5,32,255,16,255,32}, {5,0,18,32,255,0,32,32}, {18,0,18,32,255,3,255,32}, {5,0,18,32,255,0,3,32}, {18,0,0,32,16,1,18,32}, {0,5,0,32,32,255,32,32}, {5,32,5,32,255,17,255,32}, {5,32,5,32,255,2,255,32}, {5,32,5,32,255,7,255,32}, {18,2,18,32,18,0,18,32}, {5,32,5,32,32,255,32,32}, {7,7,18,32,18,1,16,32}, {5,0,32,32,255,16,32,32}, {3,2,32,32,32,32,3,32}, {0,5,32,32,16,255,32,32}, {4,3,32,32,32,32,32,32}, {32,32,32,32,2,2,2,32}, {3,32,32,32,32,32,32,32}, {32,2,2,32,255,16,255,32}, {5,2,32,32,255,16,255,32}, {32,2,2,32,255,16,16,32}, {32,2,5,32,255,16,255,32}, {2,16,2,32,255,1,1,32}, {16,18,1,32,32,255,32,32}, {17,6,17,32,16,2,255,32}, {5,2,32,32,255,32,255,32}, {16,32,32,32,255,32,32,32}, {32,16,32,32,2,5,32,32}, {5,4,32,32,255,3,32,32}, {5,32,32,32,255,32,32,32}, {2,32,2,32,255,0,255,32}, {2,16,2,32,255,32,255,32}, {32,2,32,32,255,2,255,32}, {17,6,17,32,5,32,32,32}, {17,6,17,32,32,32,5,32}, {2,16,2,32,255,32,32,32}, {2,16,16,32,16,1,7,32}, {16,5,16,32,16,255,32,32}, {2,32,2,32,255,16,255,32}, {2,32,2,32,255,2,255,32}, {2,32,2,32,255,7,255,32}, {2,32,2,32,16,7,16,32}, {17,2,17,32,32,2,5,32}, {16,16,2,32,18,1,1,32}, {2,4,32,32,0,3,32,32}, {32,5,32,32,32,255,32,32}, {3,2,32,32,4,0,32,32}, {4,3,4,32,32,32,32,32}, {5,5,5,32,5,5,5,32} }; #endif class LiquidCrystal_mx300 : public Print { public: LiquidCrystal_mx300(uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7); LiquidCrystal_mx300(uint8_t rs, uint8_t rw, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7); LiquidCrystal_mx300(uint8_t rs, uint8_t rw, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3); LiquidCrystal_mx300(uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3); void init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7); void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS); void clear(); void home(); void noDisplay(); void display(); void noBlink(); void blink(); void noCursor(); void cursor(); void scrollDisplayLeft(); void scrollDisplayRight(); void leftToRight(); void rightToLeft(); void autoscroll(); void noAutoscroll(); void clearBigfont(); void setBigfont(); void mirrorHorz(); void mirrorVert(); void rotate180(); void noMirror(); void createChar(uint8_t, uint8_t[]); void setCursor(uint8_t i, uint8_t j, bool k = true); virtual size_t write(uint8_t); void command(uint8_t); private: void send(uint8_t, uint8_t); void write4bits(uint8_t); void write8bits(uint8_t); void pulseEnable(); void writeBig(uint8_t, uint8_t); uint8_t _rs_pin; // LOW: command. HIGH: character. uint8_t _rw_pin; // LOW: write to LCD. HIGH: read from LCD. uint8_t _enable_pin; // activated by a HIGH pulse. uint8_t _data_pins[8]; uint8_t _displayfunction; uint8_t _displaycontrol; uint8_t _displaymode; uint8_t _numlines, _currline; uint8_t _numcols, _currcol; bool _autoscroll; // auto scroll left if writing beyond column 19 bool _shifted; // we have reached column 20 bool _writebig; // LCD writes will be as bigfont characters }; #endif