Mark Schwarzer / Mbed 2 deprecated Project_OCE360

Dependencies:   mbed

Revision:
12:2f1e8b205d0f
Parent:
11:b62f06b3e398
Child:
13:197c4f61b3b7
Child:
15:6cb9a9ede7fe
--- a/main.cpp	Sun Dec 06 21:22:00 2020 +0000
+++ b/main.cpp	Tue Dec 08 02:34:01 2020 +0000
@@ -13,8 +13,8 @@
 Serial pc(USBTX, USBRX);    //initial serial
 Serial BLE(p13,p14);        //Bluetooth
 LSM9DS1 IMU(p28, p27, 0xD6, 0x3C);  //initial IMU
-LM19 temp(p19);
-PhotoCell light(p20);
+LM19 t_sensor(p19);
+PhotoCell photo(p20);
 MS5837 p_sensor(p9, p10, ms5837_addr_no_CS);  //pressure sensor
 PwmOut thruster(p21);  //set PWM pin    //max 1.3ms min 1.1ms
 PwmOut thruster2(p22); //set PWM pin
@@ -175,8 +175,7 @@
 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]);
-    fprintf(fp, "$SCI, 1, 3, %.3f, %.3f, %.3f; %\r\n", t.read(), t_sensor.temp(), Pcell.read());
+    fprintf(fp, "$IMU,3,15, %f, %3.3f, %3.3f, %3.3f, %3.3f, %3.3.f, %3.3f, %3.3f, %3.3f, %3.3f, %3.3f, %3.3f, %3.3f, %3.3f, %3.3f;\r\n",t.read(),p_sensor.depth(),p_sensor.MS5837_Temperature(),thruster.pulsewidth(7),accel[0],accel[1],accel[2],gyro[0],gyro[1],gyro[2],euler[0],euler[1],euler[2],t_sensor.temp(),photo.light());
     fclose(fp);
     
     // log pulse width