Other Parts Discussed in Thread: MSPM0C1104, MSPM0L1306
Tool/software:
i download the example of uart_rw_multibyte_fifo_poll_LP_MSPM0C1104_nortos_ticlang
can print at UART with 4 words, "MSP!"
and if i have a float variable,
is there any way i can print at UART?
just like below code.
include <stdio.h> int main(){ uint8_t correct_word[4] = {'M', 'S', 'P', '!'}; DL_UART_Main_fillTXFIFO(UART_0_INST, &correct_word[0], 4); while (DL_UART_Main_isBusy(UART_0_INST)) ; // previous is work correctly, show the "MSP!" correct // below will be compile ok, but nothing show at UART. float tmp =23.6f; char buffer[50]={0}; sprintf(buffer, "%4.1f", tmp); DL_UART_Main_fillTXFIFO(UART_0_INST, &buffer[0], 4); while (DL_UART_Main_isBusy(UART_0_INST)) ; }
as i know, maybe i need something like FTOA function or need compile with float support or else,
is there any hints can provide to me?