Thermal Printer APSEPM207LV Operations

Dependencies:   APSEPM207LV

Related Data Sheets of APSEPM207LV

Revision:
0:bef4544b0c87
--- /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