Hello all,
I want to read data from an SD card. I can read the display, but they only print the "char" value. Can anyone teach me how to read a float or decimal value and print it? now i am using imxrt1050 board using mcuXpresso.
Thanks
iMXRT1050 @nxp @IMXRT1050
We successfully write on the SD card and read from the SD card, while reading from SD card we were able get data via "char" only. To get the data we are receiving by using sprintf and fscanf function.
In SD card file we have provided integer data and we want to read data such as double and float.
For above technical support u provide solution as use float pointer for that can provide a example to execute?
Hi @Shashi_ranjan_14 ,
Like these code
char ch;
float *p;
char data[4];
float i=3.14159;
char *pd;
PRINTF("%f\r\n",i);
pd = (char*)&i;
for(ch=0;ch<4;ch++)
data[ch]=*pd++;
p=(float*)&data[0];
PRINTF("%f\r\n",*p);
Regards,
Jing