AS-289R2 Thermal Printer shield control library
Dependents: AS-289R2_Hello-World AS-289R2_Hello-World-mbed-OS hybrid_image_as289r2 microbit_AS-289R2 ... more
Diff: AS289R2.h
- Revision:
- 5:fa3d63a975d9
- Parent:
- 4:a2e0373a9cd1
- Child:
- 6:6aac36a293c7
diff -r a2e0373a9cd1 -r fa3d63a975d9 AS289R2.h --- a/AS289R2.h Fri Feb 03 09:28:48 2017 +0000 +++ b/AS289R2.h Fri Feb 03 09:59:48 2017 +0000 @@ -36,11 +36,45 @@ * #include "mbed.h" * #include "AS829R2.h" * + * Serial pc(USBTX, USBRX); * AS829R2 tp(D1); // tx, 9600bps * - * int main() { - * tp.printf("Hello World!\r"); - * } + *int main() + *{ + * tp.initialize(); + * tp.putLineFeed(2); + * + * tp.printf("** Thermal Printer Shield **\r\r"); + * + * tp.setDoubleSizeWidth(); + * tp.printf(" AS-289R2\r\r"); + * tp.clearDoubleSizeWidth(); + * + * tp.printf("日本語文字列の印字テスト:24x24\r"); + * tp.setKanjiFont(AS289R2::KANJI_16x16); + * tp.setANKFont(AS289R2::ANK_8x16); + * tp.printf("日本語文字列の印字テスト:16x16\r\r"); + * + * tp.setKanjiFont(AS289R2::KANJI_DEFAULT); + * tp.setANKFont(AS289R2::ANK_DEFAULT); + * tp.setDoubleSizeWidth(); + * tp.printf("ABCDEFG 0123456789\r"); + * tp.clearDoubleSizeWidth(); + * + * tp.setDoubleSizeHeight(); + * tp.printf("ABCDEFG 0123456789\r"); + * tp.clearDoubleSizeHeight(); + * + * pc.printf("AS-289R2 thermal printer shield test\n\n"); + * while(1) { + * if (pc.readable()) { + * int c = pc.getc(); + * pc.putc(c); + * tp.putc(c); + * } + * } + * + *} * @endcode */ class AS289R2 : public Stream