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 MMA8452Q MS5837 SDFileSystem SCI_SENSOR
Diff: main.cpp
- Revision:
- 15:09aa3c2684b2
- Parent:
- 14:ed172dec4022
- Parent:
- 13:c886dcc0ea41
- Child:
- 16:6cc2ad084c2d
--- a/main.cpp Thu Dec 02 14:44:42 2021 +0000 +++ b/main.cpp Thu Dec 02 14:46:35 2021 +0000 @@ -1,9 +1,8 @@ -//Eliza -//Megan -/* -Author Mingxi Zhou -OCE360 underwater float template program -*/ +//OCE 360 Final Project +//Annaliese Nardi, Eliza Taylor, Mackenzie Fraser, Megan Gimple +//Updated Code by Stephen Licht +//Description: + #include "mbed.h" #include "MMA8452Q.h" //accelerometer library #include "MS5837.h" //pressure sensor library*** @@ -57,6 +56,9 @@ //void thrust_off(float pw, float on_time); // turn off pulse width +//global variables + + //-------------Main functions----------------------------------------------------------------------------------------- int main() { @@ -148,12 +150,24 @@ ///-----------log functions---------------------/// void log_data() { - //log system time t.read() + float current_time=t.read(); + float current_pressure=p_sensor.MS5837_Pressure(); + float current_depth=p_sensor.depth(); + float current_pw=percent; + float current_Xaccel=accelData[0]; + float current_Yaccel=accelData[1]; + float current_Zaccel=accelData[2]; + float current_temp=temp.temp(); + float current_light=light.light(); + + fprintf(fp, "$DATA, %f, %f, %f, %f, %f, %f, %f, %f, %f\r\n", current_time,current_pressure,current_depth,current_Xaccel,current_Yaccel,current_Zaccel,current_temp,current_light,current_pw); + + // log system time t.read() // log imu data, log science data // log pulse width // log pressure sensor data. - //science sensor: temp.temp(), light.light() - //IMU sensor + // science sensor: temp.temp(), light.light() + // IMU sensor }