用PE生成的函数,如果用上位机的串口调试软件,可以发送和字符和字符串,同时,也能够收到相应的字符和字符串。
现在的问题是我想把收到的这个字符串存到变量里,可是在如下的函数中,只能保存最后一个字符,这是为什么呢
谢谢大家了
void main(void)
{
/* Write your local variable definition here */
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization. ***/
for(;;) {
i=0;
if(AS1_GetCharsInRxBuf()!=0)
{
AS1_RecvChar(&data);
string=wwww;
i++;
AS1_SendChar(data);
}
}
/* Write your code here */
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;){}
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of ma
[此贴子已经被作者于2009-2-9 14:51:53编辑过]
void main(void)
{
/* Write your local variable definition here */
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization. ***/
i=1;
for(;data!='D';) {
if(AS1_GetCharsInRxBuf()!=0){
AS1_RecvChar(&data);
string=data;
i++;
AS1_SendChar(data);
}
}
j=999;
/* Write your code here */
for(;;){}
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;){}
谢谢
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |