Shivanand Gowda / Mbed OS Thermal_Printer

Dependencies:   APSEPM207LV

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003  #include "APSEPM207LV.h"
00004  
00005   Serial pc(USBTX, USBRX);
00006   APSEPM207LV tp(D1,D0); // tx, 9600bps
00007  
00008   int main()
00009   {
00010       tp.initialize();
00011       tp.putLineFeed(2);
00012  
00013       tp.printf("** Thermal Printer Shield **\r\r");
00014  
00015      
00016       tp.setKanjiFont(APSEPM207LV::KANJI_DEFAULT);
00017       tp.setANKFont(APSEPM207LV::ANK_DEFAULT);
00018      tp.setDoubleSizeWidth();
00019      tp.printf("ABCDEFG 0123456789\r");
00020      tp.clearDoubleSizeWidth();
00021 
00022      tp.setDoubleSizeHeight();
00023      tp.printf("ABCDEFG 0123456789\r");
00024      tp.clearDoubleSizeHeight();
00025 
00026      pc.printf("APS Thermal Printer\n\n");
00027      while(1) {
00028          if (pc.readable()) {
00029              int c = pc.getc();
00030              pc.putc(c);
00031              tp.putc(c);
00032          }
00033      }
00034   }
00035