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.
Revision 0:a06b510ad982, committed 2018-07-17
- Comitter:
- yuuitirou528
- Date:
- Tue Jul 17 16:12:11 2018 +0000
- Child:
- 1:6e3642607302
- Commit message:
- releas
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MS5837.lib Tue Jul 17 16:12:11 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/aolgu003/code/MS5837/#ee71a13b8e68
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Jul 17 16:12:11 2018 +0000
@@ -0,0 +1,51 @@
+//Bar02 Ultra High Resolution 10m Depth/Pressure Sensor sample
+//MS5837-02BA onry
+//ArduinoLibrary->mbedLibrary
+
+//https://os.mbed.com/teams/POTLESS/code/MS5837/
+//https://github.com/bluerobotics/BlueRobotics_MS5837_Library
+
+#include "mbed.h"
+#include "MS5837.h"
+
+
+Serial pc(USBTX, USBRX,115200); // tx, rx
+
+//I2C i2c(I2C_SDA,I2C_SCL);
+MS5837 sensor(I2C_SDA, I2C_SCL, ms5837_addr_no_CS);
+
+
+int main() {
+ // Initialize pressure sensor
+ // Returns true if initialization was successful
+ // We can't continue with the rest of the program unless we can initialize the sensor
+ printf("start");
+ sensor.MS5837Reset();
+ sensor.MS5837Init();
+ printf("ok");
+
+
+ while(1) {
+
+ sensor.Barometer_MS5837();
+
+ printf("Pressure: ");
+ printf("%f",sensor.MS5837_Pressure());
+ printf(" mbar");
+
+ printf("Temperature: ");
+ printf("%f",sensor.MS5837_Temperature());
+ printf(" deg C ");
+
+ printf("Depth: ");
+ printf("%f",sensor.depth());
+ printf(" m ");
+
+ printf("Altitude: ");
+ printf("%f",sensor.altitude());
+ printf(" m above mean sea level\r\n");
+
+
+ wait(1);
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Jul 17 16:12:11 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/a7c7b631e539 \ No newline at end of file