/* Serial LCD library for Sparkfun.com Serial Enabled 20x4 LCD Revision: 1 Date: 2011-12-19 Author: A.Spiridonov Based on SfLCD2 code (Rev. 1 is essentially SfLCD2 modified into a library) Initialization: Initialize by creating a global object of the class, then in setup() pass the desired serial by reference Example: SerialLCD LCD; ... void setup(){ ... LCD.begin(&Serial1); ... } Functions: void print(char *theText); - prints the passed char array over 4 lines(if necessary). Automatically truncates to 80 characters (20x4) Example: LCD.print("This text will appear over multiple lines."); void printLine(int lineNum, char *theText); - prints the passed char array on the desired line Automatically truncates to 20 characters Example: LCD.printLine(1, "foo"); LCD.printLine(2, "bar"); */ #ifndef SerialLCD_h #define SerialLCD_h #include class SerialLCD { private: HardwareSerial *SER; public: //SerialLCD(HardwareSerial &ser) {SER = ser;}; // SerialLCD(); void begin(HardwareSerial *serial); void print(char *theText); void printLine(int lineNum, char *theText); void printChar(int lineNum, int charNum, char theChar); void clear(); void backlight(int thePercentage); }; #endif