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

Files at this revision

API Documentation at this revision

Comitter:
dyu2021
Date:
Tue Apr 28 20:00:56 2020 +0000
Parent:
42:30d1dfc5adaf
Commit message:
Changed serial_USB to output all lines of prev_text, not hard set to 7

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 30d1dfc5adaf -r 81f314c92d9f main.cpp
--- 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);
                     }