Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: sensors/sensors.cpp
- Revision:
- 42:b00cdc97f492
- Parent:
- 39:7f3cc8f47710
--- a/sensors/sensors.cpp	Thu May 16 09:20:59 2019 +0000
+++ b/sensors/sensors.cpp	Fri May 17 02:17:40 2019 +0000
@@ -62,7 +62,7 @@
         printf("error : FileSave()\r\n");
         return 1;
     }
-    fprintf(fp, "time[s], gyro[deg], hcsr04_forward[cm], hcsr04_back[cm], motor_lo[deg], motor_li[deg]\r\n");
+    fprintf(fp, "time[s], gyro[deg], hcsr04_forward[cm], hcsr04_back[cm], motor_lo[deg], motor_li[deg],motor_lo duty, motor_li duty\r\n");
     filetimer.reset();
     filetimer.start();
     if(RightOrLeft) {
@@ -85,10 +85,14 @@
     if(fp == NULL) {
         is_first = 0;
     } else {
-        fprintf(fp, "%f, %f, %f, %f, %f, %f\r\n",
+        fprintf(fp, "%f, %f, %f, %f, %f, %f, %f, %f\r\n",
                 filetimer.read(), degree0,
-                hcsr04_val[0], hcsr04_val[1],
-                motor_lo.getPosi(), motor_li.getPosi());
+                hcsr04_val[0], 
+                hcsr04_val[1],
+                motor_lo.getPosi(), 
+                motor_li.getPosi(),
+                motor_lo.GetDuty(), 
+                motor_li.GetDuty());
     }
 }
 void FileClose()