There's a few BigFont implementations floating around, but they're rather wide -- what if you want more big numbers than will fit on your display? Enter TallFont -- double-height, but standard width
This library will let you print individual digits (printTallDigit()) as well as signed integers up to 16 bits (printTallNumber()). You could easily extend it to display longs if you chose.
You can specify a length argument and include leading zeros or leading spaces (right justify); it also supports a double-height colon "character": I added these features to make the implementation of a clock easier. You can also specify trailing spaces, which lets you overprint numbers of various lengths to the display without any flicker-inducing calls to lcd.clear(). Or, simply pass a 0 for the length argument to get a plain number without any padding.
The library has no error-checking of any sort; send it bad or silly data, and you'll get bad or silly results.
If you edit the library source, you'll find that you can choose an alternate rendering for the '9' digit if you like.
This library takes about 3.5K of flash (2.5K if you use only printTallDigit() and not printTallnumber()). It is designed to work with the Arduino IDE version 1.0.5.
It's written for the standard LiquidCrystal library, but could easily be adapted to work with any other HD44780 LCD library that supports setCursor
, and of course createChar
Code snippet (full examples in attached library zip file):
byte cursorpos = 0;
cursorpos = printTallNumber(12,2,LEADINGSPACES,cursorpos,1); // assign = cursor when using printTallNumber. it returns absolute
cursorpos += printTallDigit(COLONglyph,cursorpos,1); // increment += cursor when using printTallDigit, it returns relative
cursorpos = printTallNumber(59,2,LEADINGZEROS,cursorpos,1);
// cursor is already in the right place -- no need to lcd.setCursor()