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: main.cpp
- Revision:
- 2:5ee1cbcf8e04
- Parent:
- 1:558ab0afbbc5
- Child:
- 3:a87f5671ea8b
--- a/main.cpp Tue Dec 01 14:50:50 2020 +0000 +++ b/main.cpp Tue Dec 01 15:06:41 2020 +0000 @@ -25,7 +25,7 @@ // global timer Timer t; //MS5837 p_sensor(p9, p10, ms5837_addr_no_CS); -///File +///File FILE *fp; char fname[100]; float PI = 3.14159265358979323846f; @@ -147,6 +147,9 @@ ///-----------log functions---------------------/// void log_data() { + fp= fopen(fname, "a"); + fprintf(fp, "$IMU,3,10, %f, %3.3f, %3.3f, %3.3f, %3.3f, %3.3f, %3.3f, %3.3f, %3.3f, %3.3f;\r\n",t.read(),accel[0],accel[1],accel[2],gyro[0],gyro[1],gyro[2],euler[0],euler[1],euler[2]); + fclose(fp); //log system time t.read() // log imu data, log sciene data // log pulse width