An interface to the Sparkfun Serial Graphic LCD, LCD-09351; and Graphic LCD Serial Backpack, LCD-09352. Derived class from Serial so that you can conveniently send text to the display with printf(), putc(), etc.
Diff: SerialGraphicLCD.cpp
- Revision:
- 3:dff460658aed
- Parent:
- 2:84b78506add6
--- a/SerialGraphicLCD.cpp Thu Mar 29 18:33:42 2012 +0000 +++ b/SerialGraphicLCD.cpp Wed Apr 11 07:13:52 2012 +0000 @@ -4,7 +4,14 @@ #define YSIZE 9 SerialGraphicLCD::SerialGraphicLCD(PinName tx, PinName rx): - Serial(tx, rx) + Serial(tx, rx), _firmware(SFE_FW) +{ + baud(115200); // default baud rate + resolution(LCD_128x64); // default resolution +} + +SerialGraphicLCD::SerialGraphicLCD(PinName tx, PinName rx, int firmware): + Serial(tx, rx), _firmware(firmware) { baud(115200); // default baud rate resolution(LCD_128x64); // default resolution @@ -16,7 +23,10 @@ } void SerialGraphicLCD::pos(int col, int row) { - posXY(XSIZE*col, _yMax-(YSIZE*row)-1); + if (_firmware == SD_FW) + posXY(XSIZE*col, (YSIZE*row)); + else if (_firmware == SFE_FW) + posXY(XSIZE*col, _yMax-(YSIZE*row)-1); } void SerialGraphicLCD::posXY(int x, int y) {