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.
Fork of ReadingMag_HMC5883L by
Revision 1:ed9abb368fcf, committed 2015-03-02
- Comitter:
- masterholy
- Date:
- Mon Mar 02 09:06:19 2015 +0000
- Parent:
- 0:6bc5f85ca6fa
- Commit message:
- test module for fibo
Changed in this revision
--- a/main.cpp Tue May 21 13:48:10 2013 +0000
+++ b/main.cpp Mon Mar 02 09:06:19 2015 +0000
@@ -1,20 +1,23 @@
#include "mbed.h"
#include "HMC5883L.h"
-
+#include "ms5611.h"
#include <math.h>
-#define SDA p9
-#define SCL p10
+#define SDA PB_9
+#define SCL PB_8
#define PI 3.14159265
int main()
{
float x, y, z, heading;
+ float p;
/*
float m_x, m_y, m_z;
*/
printf("Inicializing...\r\n");
HMC5883L hmc5883l(SDA, SCL);
+ ms5611 baro(SDA, SCL);
+ baro.cmd_reset();
//HMC5883L *hmc5883l = new HMC5883L(SDA, SCL);
printf("OK...\r\n");
/*
@@ -43,7 +46,7 @@
x = hmc5883l.getMx();
y = hmc5883l.getMy();
z = hmc5883l.getMz();
-
+ p = baro.getPressure();
heading = atan2(y, x);
if(heading < 0)
heading += 2*PI;
@@ -63,6 +66,7 @@
printf("x: %f \t\ty: %f \t\t z: %f \t\t heading: %f \t\r\n", x, y, z, heading);
+ printf("pressure : %f \n",p);
wait_ms(200);
}
--- a/mbed.bld Tue May 21 13:48:10 2013 +0000 +++ b/mbed.bld Mon Mar 02 09:06:19 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/5e5da4a5990b \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5 \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ms5611.lib Mon Mar 02 09:06:19 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/loopsva/code/ms5611/#90ee2168baa7
