Other Parts Discussed in Thread: CCSTUDIO
Tool/software: Code Composer Studio
Hello,
I am unable to do printf with floating numbers read from a text file while integer value is working.
My original work is to read floating values into an array. The code i have written is below
#include <stdio.h>
int main(void)
{
float c; // To store a character read from file
int i,ff,ecgArray[1200];
FILE *fp;
fp = fopen("E:\\processor\\ecgData.txt", "r");
char buff[255];
float j;
for(i=0;i<10;i++)
{
fgets(buff, 255, (FILE*)fp);
printf("%d:",i+1);
printf("%d: %s\n",i+1,buff);
sscanf (buff," %f", &j);
ff = j*1000;
// ecgArray[i]=ff;
//ecgArray[i] = ecgArray[i]/1000;
printf(" j val= %d\n", ff );
}
fclose(fp);
return 0;
}
I tried changing the heap size and stack size to 0x400. I am new towards working with CCStudio. Kindly help.
0.02 0.025 0.05 0.075 0.0875 0.125 0.15 0.1625 0.175 0.2 0.225 0.2375 0.25 0.2625 0.2625 0.2875 0.2875 0.2875 0.2875 0.2875 0.2875 0.2875 0.275 0.2625 0.2625 0.25 0.25 0.225 0.225 0.2 0.2 0.175 0.175 0.15 0.15 0.1375 0.1375 0.15 0.1625 0.1875 0.225 0.2625 0.3 0.325 0.35 0.3625 0.3875 0.3875 0.3875 0.3875 0.3875 0.3875 0.3875 0.3875 0.3875 0.3875 0.3875 0.3875 0.3625 0.3625 0.3625 0.3625 0.3625 0.3625 0.3625 0.3625 0.3625 0.3625 0.3625 0.3375 0.3375 0.35 0.3625 0.3625 0.3625 0.3625 0.3625 0.3625 0.3625 0.3625 0.3625 0.3625 0.3625 0.3625 0.3625 0.35 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.3375 0.325 0.3375 0.7625 1.225 1.525 1.6125 1.1 0.5375 0.0625 0.0375 0.05 0 0.025 0.05 0.075 0.0875 0.125 0.15