第一个问题是;在串口输出时用printf好还是调用串口输出函数
第二个问题是[img=0,1]file:///C:UserspgfDocumentsTencent Files1149777206ImageGroupRP@HDSL[$)0E(}Y@}(5DTGF.png[/img][img=0,1]file:///C:UserspgfDocumentsTencent Files1149777206ImageGroupRP@HDSL[$)0E(}Y@}(5DTGF.png[/img];当我程序这样写时void HIM_Display(int Data)
{
u16 p[10],q[10];
u16 status;
signed char y=0,x=0 ,f;
q[y]= Data%10;
status = Data/10;
while(status!= 0)
{
y++;
q[y]=(status%10);
status = status/10;
}
/* UART_PutStr(USART1,"t3.txt=");
UART_PutChar(USART1,'"');*/
printf("%s","t3.txt=");
printf("%c",'"');
for(f=y;f>=0;f--)
{
p[x]=q[f];
printf("%d",p[x]);
x++;
}
printf("%c",'"');
UART_PutChar(USART1,0xff);
UART_PutChar(USART1,0xff);
UART_PutChar(USART1,0xff);
}调用void HIM_Display(i1234)输出1234
当我程序这样写时
oid HIM_Display(int Data)
{
u16 p[10],q[10];
u16 status;
signed char y=0,x=0 ,f;
q[y]= Data%10;
status = Data/10;
while(status!= 0)
{
y++;
q[y]=(status%10);
status = status/10;
}
UART_PutStr(USART1,"t3.txt=");
UART_PutChar(USART1,'"');
for(f=y;f>=0;f--)
{
p[x]=q[f];
printf("%d",p[x]);
x++;
}
printf("%c",'"');
UART_PutChar(USART1,0xff);
UART_PutChar(USART1,0xff);
UART_PutChar(USART1,0xff);
}调用void HIM_Display(i1234)输出123
第三个问题;图片
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>