Atoi() and HAL_UART
Hello,
My question is about language C.
My nucleo receive some AT Command (from my pc) and i have write a function for compute the command.
Ex : AT+SPEED? > return "SPEED" (only).
>I 'm able to get only the command (by print over uart).
>My command is store inside a array.
command [0] = S
command [1] = P
...
Now a need to return this "value" from my function to another. One way is to convert this array into a string with atoi() function.
//------------------------------------------
return data =atoi(command);
//------------------------------------------
uint16_t Array[10];
sprintf( Array, "%c",command_value) ;
HAL_UART_Transmit(&huart1, Array, strlen(Array), 100);
it doesn't work, i mean no print.
I think is not a STM32 problem but a C problem.
Someone have an idea ?
