7184| 2
|
[求助] 热敏打印机如何打出中文? |
我在DFrobot上看到如下代码,我试了一下,可是打印出来都是乱码。链接 代码: /*! @file DFR0503.ino @brief Embedded Thermal Printer - TTL Serial @n [Get the module here]() @n This example is the Chinese characters printed on the paper roll and character. @n [Connection and Diagram](链接) @copyright [DFRobot](http://www.dfrobot.com), 2017 @copyright GNU Lesser General Public License @author [lijun](ju.li@dfrobot.com) @version V1.0 @date 2017-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[0]); mySerial.println(hz[1]); mySerial.println(hz[2]); mySerial.println(hz[3]); mySerial.println(hz[4]); mySerial.println(hz[5]); mySerial.println(hz[6]); mySerial.println(); mySerial.println(); mySerial.println(); delay(10000);} .c文件 const char hz[][32]={"DFROBOT", //0"极趣科技", //1"嵌入式热敏打印机", //2"arduino开发控制", //3"DIY趣味", //4"让我们一起共创未来", //5"打造我们的DIY世界", //6}; https://mail.google.com/mail/u/0 ... 050fe4a4e&zw&atsh=1 谢谢各位大神!! |
© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed