5531| 12
|
QT异步串口通讯控制led灯的亮灭 |
5金钱
最佳答案在QT上面不能实现发送“开启”/“关闭”这样子的汉字来控制led吧?发送“0”/“1”这样的数组控制led应该没问题吧?
如果是上面的猜测的话,那就是QT5中汉字的默认编码是utf-8,而你单片机的汉字编码不是utf-8导致的。
utf-8编码,英文用1byte,汉字用3byte
GBK/GB2312编码,英文用1byte,汉字用2byte。
你用“0”/“1”控制应该没问题,它们都是0x30 0x31;但是你用“开启”/“关闭”来控制就要注意QT和单片机的汉字编码格式 ...
| ||
| ||
He who fights with monsters should look to it that he himself does not become a monster, when you gaze long into the abyss, the abyss also gazes into you.
过于执着就会陷入其中,迷失自己,困住自己。 |
||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
He who fights with monsters should look to it that he himself does not become a monster, when you gaze long into the abyss, the abyss also gazes into you.
过于执着就会陷入其中,迷失自己,困住自己。 |
||
| ||
|手机版|OpenEdv-开源电子网
( 粤ICP备12000418号-1 )
GMT+8, 2025-6-21 04:26
Powered by OpenEdv-开源电子网
© 2001-2030 OpenEdv-开源电子网