/* Copyright (C) 2011 by Jack W. Kern Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef __LCD117_H_ #define __LCD117_H_ class NewSoftSerial; // Predecl #define DECIMAL 0 #define HEX 1 class LCD117 { NewSoftSerial* mySerial; // Serial port int nCx, nCy; // Cursor Position int nCharWidth; // Total width in characters of the display int nCharHeight; // Total height in characters of the display char szBuffer[32]; // Working buffer for print functions public: LCD117 ( int nCharWidth=20, int nCharHeight=4 ); ~LCD117 ( void ); void begin ( int txPin, int rxPin=4, int nBaud=9600 ); void clearLCD ( void ); void showCursor ( void ); void hideCursor ( void ); void defineCharacter ( int nIndex, const char* pBitArray ); void setCursor ( int x, int y ); void printCustom ( int nIndex ); void print ( const char* pszText ); void print ( int nValue, int nFormat ); void println ( const char* pszText ); void println ( int nValue, int nFormat ); private: void initDisplaySize ( int, int ); void updateCursor ( const char* pszText ); void wrapCursor ( void ); void printCursor ( void ); }; #endif //__LCD117_H_