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: L3GD20 LSM303DLHC mbed
Fork of minimu-9v2 by
Diff: main.cpp
- Revision:
- 0:4b3d36de811a
- Child:
- 1:7363eeef6409
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Feb 21 00:24:06 2013 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+#include "L3GD20.h"
+#include "LSM303DLHC.h"
+
+L3GD20 gyro(p28, p27);
+Serial debug(USBTX,USBRX);
+LSM303DLHC compass(p28, p27);
+
+
+
+ int main() {
+ float ax, ay, az;
+ float mx, my, mz;
+ float gx, gy, gz;
+ debug.format(8,Serial::None,1);
+ debug.baud(115200);
+ debug.printf("miniimu-9 v2 Test");
+
+ while(1) {
+
+ compass.read(&ax, &ay, &az, &mx, &my, &mz);
+ gyro.read(&gx, &gy, &gz);
+ debug.printf("a %.4f %.4f %.4f m %.4f %.4f %.4f m %.4f %.4f %.4f\n\r",ax,ay,az,mx,my,mz,gx,gy,gz);
+ wait(0.05);
+ }
+ }
\ No newline at end of file
