
Thermal Printer APSEPM207LV Operations
Related Data Sheets of APSEPM207LV
Diff: main.cpp
- Revision:
- 0:bef4544b0c87
diff -r 000000000000 -r bef4544b0c87 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon May 21 07:30:57 2018 +0000 @@ -0,0 +1,35 @@ +#include "mbed.h" + + #include "APSEPM207LV.h" + + Serial pc(USBTX, USBRX); + APSEPM207LV tp(D1,D0); // tx, 9600bps + + int main() + { + tp.initialize(); + tp.putLineFeed(2); + + tp.printf("** Thermal Printer Shield **\r\r"); + + + tp.setKanjiFont(APSEPM207LV::KANJI_DEFAULT); + tp.setANKFont(APSEPM207LV::ANK_DEFAULT); + tp.setDoubleSizeWidth(); + tp.printf("ABCDEFG 0123456789\r"); + tp.clearDoubleSizeWidth(); + + tp.setDoubleSizeHeight(); + tp.printf("ABCDEFG 0123456789\r"); + tp.clearDoubleSizeHeight(); + + pc.printf("APS Thermal Printer\n\n"); + while(1) { + if (pc.readable()) { + int c = pc.getc(); + pc.putc(c); + tp.putc(c); + } + } + } + \ No newline at end of file