DSP怎么向串口发送数据呢?
时间:10-02
整理:3721RD
点击:
DSP怎么向串口发送数据呢?比如我想发送一个变量last_ad_result的具体值,我用语句
while(SciaRegs.SCIFFRX.bit.RXFFST !=1) { }
ReceivedChar = SciaRegs.SCIRXBUF.all;
msg = " The temperature is:last_ad_result\0";
scia_msg(msg);
i = 0;
while(msg[i] != '\0')
{
scia_xmit(msg[i]);
i++;
}
void scia_xmit(int a)
{
while (SciaRegs.SCIFFTX.bit.TXFFST != 0) {}
SciaRegs.SCITXBUF=a;
}
但是用串口助手显示的是The temperature is:last_ad_result啊,而不是The temperature is:某个数值啊
while(SciaRegs.SCIFFRX.bit.RXFFST !=1) { }
ReceivedChar = SciaRegs.SCIRXBUF.all;
msg = " The temperature is:last_ad_result\0";
scia_msg(msg);
i = 0;
while(msg[i] != '\0')
{
scia_xmit(msg[i]);
i++;
}
void scia_xmit(int a)
{
while (SciaRegs.SCIFFTX.bit.TXFFST != 0) {}
SciaRegs.SCITXBUF=a;
}
但是用串口助手显示的是The temperature is:last_ad_result啊,而不是The temperature is:某个数值啊
我也想知道,求解释
msg = " The temperature is:last_ad_result\0";明显last_ad_result作为字符串发出去了 而不是作为一个变量
很好的资料!····