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:
- 37:7bb14ad22d78
- Parent:
- 36:93a04bd48152
- Child:
- 38:46975eaa1400
--- a/main.cpp Wed Dec 08 22:06:40 2021 +0000 +++ b/main.cpp Wed Dec 08 22:16:44 2021 +0000 @@ -50,9 +50,6 @@ //IMU related void accel_update(); //update accelerometer related variables. we use imu_ticker to call this function -//IMU related -void accel_update(); //update accelerometer related variables. we use imu_ticker to call this function - //Control Parameters float tim = 1; //define thruster on time float percent = 1.5; //user defined percent of thrust power @@ -191,26 +188,25 @@ ///-----------log functions---------------------/// void log_data() { - + p_sensor.Barometer_MS5837(); //Code from Licht //Sample code shows how to read temperature and light data: - BLE.printf("Temperature: %f Light: %f\r\n",temp.temp(), light.light()); + //BLE.printf("Temperature: %f Light: %f\r\n",temp.temp(), light.light()); //Sample code shows how to read pressure sensor - BLE.printf("Depth: %f Pressure: %f Temperature: %f\r\n", p_sensor.depth(), p_sensor.MS5837_Pressure(), p_sensor.MS5837_Temperature()); - p_sensor.Barometer_MS5837(); //NOTE: this function prompts the pressure sensor to collect the next data point, so it must be included! + //BLE.printf("Depth: %f Pressure: %f Temperature: %f\r\n", p_sensor.depth(), p_sensor.MS5837_Pressure(), p_sensor.MS5837_Temperature()); + //p_sensor.Barometer_MS5837(); //NOTE: this function prompts the pressure sensor to collect the next data point, so it must be included! //Sample code indicates how to read accelerometer data: - BLE.printf("Acceleration: %f %f %f\r\n",accelData[0],accelData[1],accelData[2]); + //BLE.printf("Acceleration: %f %f %f\r\n",accelData[0],accelData[1],accelData[2]); //end of code from Licht - + fp = fopen(fname, "a"); fprintf(fp, "$DATA"); // Time:%f, Pressure:%f, Depth:%f, Acceleration:%f, %f, %f, Temp:%f, Light:%f, Percent:%f\r\n", t.read(),p_sensor.MS5837_Pressure(),p_sensor.depth(),accelData[0],accelData[1],accelData[2],temp.temp(),light.light(),percent); fclose(fp); - } ///-----------acceleromter related functions---------------------///