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.
Dependencies: mbed MS5837_final LSM9DS1_final SDFileSystem_final SCI_SENSOR_final
Diff: main.cpp
- Revision:
- 2:ba90f3e05798
- Parent:
- 1:88ebad269e60
- Child:
- 3:8975c76293be
diff -r 88ebad269e60 -r ba90f3e05798 main.cpp
--- a/main.cpp Tue Dec 01 14:41:24 2020 +0000
+++ b/main.cpp Tue Dec 01 14:46:30 2020 +0000
@@ -19,6 +19,8 @@
PwmOut thruster2(p22); //set PWM pin
SDFileSystem sd(p5, p6, p7, p8, "sd"); // the pinout on the mbed Cool Components workshop board
+float pw;
+
//global ticker
Ticker log_ticker;
Ticker imu_ticker;
@@ -129,7 +131,7 @@
error("Could not open file for write\n");
}
- fprintf(fp, "$NEMA,1,3,%.3f,%.3f,%.3f;", t.read(), //log system time t.read()
+ fprintf(fp, "$NEMA,1,15,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f;", t.read(), //log system time t.read()
p_sensor.depth(), p_sensor.MS5837_Temperature(), // log pressure sensor data.
pw, // log pulse width
IMU.calcAccel(IMU.ax), IMU.calcAccel(IMU.ay), IMU.calcAccel(IMU.az), // log imu data, log sciene data
@@ -137,7 +139,7 @@
euler[0],euler[1],euler[2], //IMU sensor
temp.temp(), light.light()); //science sensor: temp.temp(), light.light()
- fclose();
+ fclose(fp);
}
