TextLCD library for controlling various LCD panels based on the HD44780 4-bit interface
Fork of TextLCD by
Revision 10:b91bc4431350, committed 2014-12-13
- Comitter:
- sillevl
- Date:
- Sat Dec 13 13:59:10 2014 +0000
- Parent:
- 9:308d188a2d3a
- Parent:
- 8:dde7f427feda
- Commit message:
- added custom characters
Changed in this revision
TextLCD.cpp | Show annotated file Show diff for this revision Revisions of this file |
TextLCD.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 308d188a2d3a -r b91bc4431350 TextLCD.cpp --- a/TextLCD.cpp Thu Jan 02 21:07:01 2014 +0000 +++ b/TextLCD.cpp Sat Dec 13 13:59:10 2014 +0000 @@ -157,3 +157,25 @@ return 2; } } + +/* + +@param cgramloc cgram location from 0-7 + +@param *data char array + +@param cgrpos cgrampostion 0x00-0x07 + +@param x,y location coordinates + +*/ + +void TextLCD::putCustomChar(int cgramloc, char *data){ + + writeCommand(0x40+((cgramloc&0x07)<<3)); //Set CG-RAM address + + for (int i=0; i<8; i++) { + writeData(*data++); + } + +}
diff -r 308d188a2d3a -r b91bc4431350 TextLCD.h --- a/TextLCD.h Thu Jan 02 21:07:01 2014 +0000 +++ b/TextLCD.h Sat Dec 13 13:59:10 2014 +0000 @@ -84,6 +84,7 @@ /** Clear the screen and locate to 0,0 */ void cls(); + void putCustomChar(int cgramloc, char *data); int rows(); int columns();