This is a repository for code relating to mbed Fitness Tracker
Dependencies: mbed PulseSensor2 SCP1000 mbed-rtos 4DGL-uLCD-SE LSM9DS1_Library_cal PinDetect FatFileSystemCpp GP-20U7
Diff: main.cpp
- Revision:
- 43:81f314c92d9f
- Parent:
- 42:30d1dfc5adaf
--- a/main.cpp Tue Apr 28 18:06:35 2020 +0000 +++ b/main.cpp Tue Apr 28 20:00:56 2020 +0000 @@ -512,8 +512,8 @@ if(fp == NULL) { error("Could not open file for write\n"); } - for (int i = 0; i<7; i++) { - fscanf(fp,"%s\t%d\t%d\t%f\t%f\n\r", &buf_date[0], &buf_steps[0], &buf_flights[0], &buf_calories[0], &buf_distance[0]); + while (fscanf(fp,"%s\t%d\t%d\t%f\t%f\n\r", &buf_date[0], &buf_steps[0], &buf_flights[0], &buf_calories[0], &buf_distance[0]) != EOF) { + //fscanf(fp,"%s\t%d\t%d\t%f\t%f\n\r", &buf_date[0], &buf_steps[0], &buf_flights[0], &buf_calories[0], &buf_distance[0]); sprintf(buffer,"%s\t%d\t%d\t%f\t%f\n", buf_date, buf_steps[0], buf_flights[0], buf_calories[0], buf_distance[0]); pc.printf("%s",buffer); }