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:
- 11:fc58334fd36b
- Parent:
- 3:22a86bc49f44
- Child:
- 12:54b498af39df
--- a/main.cpp Tue Nov 30 14:35:56 2021 +0000 +++ b/main.cpp Thu Dec 02 14:31:52 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*** @@ -49,6 +48,9 @@ //Control related functions void thrust_on(float pw, float on_time); //input is pulse width +//global variables + + //-------------Main functions----------------------------------------------------------------------------------------- int main() { @@ -128,12 +130,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 }