I can't read uint data(in text file) from sdcard which has been written from stm32 adc. I am able to write data to sd card but weird symbols appear when I open txt file in my latop.
I am using SDIO and FATFS
if(f_mount(&myFAT,SD_Path, 1)==FR_OK)
{
HAL_GPIO_TogglePin(GPIOD, GPIO_PIN_14);
f_open(&myFile, "test1.txt\0",FA_WRITE|FA_CREATE_ALWAYS);
for(int i=0; i<1000;i++){
sprintf(msg,"%hu\r\n",data[i]);
f_write(&myFile,msg,10,&byteCount);
}
f_close(&myFile);
HAL_GPIO_TogglePin(GPIOD, GPIO_PIN_15);
}