This is the Adafruit thermal printer, whose Arduino library is published here: http://www.ladyada.net/products/thermalprinter/. This is a basic port to mbed that needs proper testing. The first printBitmap function is implemented but not fully tested, the stream versions are not ported yet.
Dependents: SMS_LEDMatrixPrinter
Fork of AdafruitThermalPrinter by
Diff: AdafruitThermal.cpp
- Revision:
- 2:6c38e763c285
- Parent:
- 1:315c49946ded
- Child:
- 3:0e12bed6b295
--- a/AdafruitThermal.cpp Fri Jun 29 08:42:23 2012 +0000 +++ b/AdafruitThermal.cpp Tue Nov 20 13:07:13 2012 +0000 @@ -302,7 +302,7 @@ underlineOn(0); } -/* + void AdafruitThermal::printBitmap(int w, int h, const uint8_t *bitmap) { if (w > 384) return; // maximum width of the printer for (int rowStart=0; rowStart < h; rowStart += 256) { @@ -312,13 +312,14 @@ writeBytes(chunkHeight, w/8); delay(500); for (int i=0; i<((w/8)*chunkHeight); i++) { - PRINTER_PRINT(pgm_read_byte(bitmap + (rowStart*(w/8)) + i)); + PRINTER_PRINT(bitmap[(rowStart*(w/8)) + i]); +// PRINTER_PRINT(pgm_read_byte(bitmap + (rowStart*(w/8)) + i)); } delay(500); } } - +/* void AdafruitThermal::printBitmap(int w, int h, Stream *stream) { if (w > 384) return; // maximum width of the printer for (int rowStart=0; rowStart < h; rowStart += 256) {