热敏打印机如何打出中文?
我在DFrobot上看到如下代码,我试了一下,可是打印出来都是乱码。链接
代码:
/*! @file DFR0503.ino @brief Embedded Thermal Printer - TTL Serial @n () @n This example is the Chinese characters printed on the paper roll and character. @n (链接) @copyright(http://www.dfrobot.com), 2017 @copyright GNU Lesser General Public License @author (ju.li@dfrobot.com) @versionV1.0 @date2017-05-23*/#include"C:\Users\Administrator\Documents\Arduino\uart_dayinji\hz.c"#include <SoftwareSerial.h>SoftwareSerial mySerial(10, 11); // RX, TXvoid setup(){mySerial.begin(9600);}void loop() {mySerial.println();mySerial.println();mySerial.println("DFROBOT");mySerial.println();mySerial.println(hz);mySerial.println(hz);mySerial.println(hz);mySerial.println(hz);mySerial.println(hz);mySerial.println(hz);mySerial.println(hz);mySerial.println();mySerial.println();mySerial.println();delay(10000);}
.c文件
const char hz[]={"DFROBOT", //0"极趣科技", //1"嵌入式热敏打印机", //2"arduino开发控制", //3"DIY趣味", //4"让我们一起共创未来", //5"打造我们的DIY世界", //6};
https://mail.google.com/mail/u/0 ... 050fe4a4e&zw&atsh=1
谢谢各位大神!!
确认一下c文件是不是GB2312格式 蓝牙的话可以容易的做到,MIT app inventor里选用GB2312汉字编码就可以识别了
页:
[1]