智能车制作
标题:
[K60]求助!!龙邱蓝牙串口乱码的问题
[打印本页]
作者:
捣毁者
时间:
2014-5-18 09:42
标题:
[K60]求助!!龙邱蓝牙串口乱码的问题
我用的龙邱的蓝牙串口
void main(void)
{
uart_init (UART3,115200);
while(1)
{
uart_putchar(UART3,'f');
}
}
用软件AccessPort接收到的不是f,但是把下载器连上运行就正常了,就能接收到f
然后发AD的时候,用的是OutPut_Data这个函数
void OutPut_Data(void)
{
int temp[4] = {0};
unsigned int temp1[4] = {0};
unsigned char databuf[10] = {0};
unsigned char i;
unsigned short CRC16 = 0;
for(i=0;i<4;i++)
{
temp[i] = (int)OutData[i];
temp1[i] = (unsigned int)temp[i];
}
for(i=0;i<4;i++)
{
databuf[i*2] = (unsigned char)(temp1[i]%256);
databuf[i*2+1] = (unsigned char)(temp1[i]/256);
}
CRC16 = CRC_CHECK(databuf,8);
databuf[8] = CRC16%256;
databuf[9] = CRC16/256;
for(i=0;i<10;i++)
uart_putchar(UART3,databuf[i]);
}
但是显示的为什么全是乱码?
欢迎光临 智能车制作 (http://dns.znczz.com/)
Powered by Discuz! X3.2