uint32 i = 444444444;
float f = 55.555f;
char *s;
//UART_SetCustomInterruptHandler(&MyIntHandler);
// isr_StartEx(UART_SCB_IRQ_Interrupt);
UART_Start(); /* Start communication component */
CyGlobalIntEnable; /* Enable interrupts */
/* Use printf() function which will send formatted data through
* UART (SCB mode) */
UART_UartPutString("Welcome\r\n");
sprintf(s, "%10.3f", 3.1415626);
printf("Test printf function. long: %ld, float: %s \n",i,s);
for(;;)
{
}
你需要把这个浮点型的数据做一个格式转换,然后就可以了。
|