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: BNO055_fusion MODSERIAL mbed
Fork of Shared-1BNO055 by
Revision 9:7be40e42e578, committed 2016-02-04
- Comitter:
- tommyallen
- Date:
- Thu Feb 04 15:48:15 2016 +0000
- Parent:
- 8:41d1f9ab3be0
- Child:
- 10:acbb851070c2
- Commit message:
- 04/02/16;
Changed in this revision
| dsp.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dsp.lib Thu Feb 04 15:48:15 2016 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/simon/code/dsp/#208cacc9d789
--- a/main.cpp Wed Feb 03 14:52:21 2016 +0000
+++ b/main.cpp Thu Feb 04 15:48:15 2016 +0000
@@ -20,6 +20,7 @@
#include "mbed.h"
#include "BNO055.h"
#include "MODSERIAL.h"
+#include "arm_math.h"
// Definition ------------------------------------------------------------------------------------
#define NUM_LOOP 100
@@ -30,6 +31,8 @@
volatile bool RAW = true;
volatile bool FUS = false;
bool printed = false;
+int Time;
+int TimeStamp;
//string sdata = "";
@@ -197,18 +200,26 @@
while (1) {
while (RAW == true) {
- pc.printf("RAW,xLSB:,%d,xMSB:,%d,yLSB:%d,yMSB:,%d,zLSB:,%d,zMSB:,%d,"
- ,imu.read_reg0(0x08),imu.read_reg0(0x09)
- ,imu.read_reg0(0x0A),imu.read_reg0(0x0B)
- ,imu.read_reg0(0x0C),imu.read_reg0(0x0D));
- pc.printf("Time:,%d,/",t.read_ms());
+ Time = t.read_ms();
+ if (Time > TimeStamp + 9) {
+ pc.printf("RAW,xLSB:,%d,xMSB:,%d,yLSB:%d,yMSB:,%d,zLSB:,%d,zMSB:,%d,"
+ ,imu.read_reg0(0x08),imu.read_reg0(0x09)
+ ,imu.read_reg0(0x0A),imu.read_reg0(0x0B)
+ ,imu.read_reg0(0x0C),imu.read_reg0(0x0D));
+ pc.printf("Time:,%d,/",t.read_ms());
+ TimeStamp = Time;
+ }
}
while (RAW == false) {
- imu.get_linear_accel(&linear_acc);
- pc.printf("FUS,x:,%+6.1f,y:,%+6.1f,z:,%+6.1f,"
- ,linear_acc.x ,linear_acc.y ,linear_acc.z
- ,t.read_ms());
- pc.printf("Time:,%d,/",t.read_ms());
+ Time = t.read_ms();
+ if (Time > TimeStamp + 9) {
+ imu.get_linear_accel(&linear_acc);
+ pc.printf("FUS,x:,%+6.1f,y:,%+6.1f,z:,%+6.1f,Total:,%+6.1f,"
+ ,linear_acc.x ,linear_acc.y ,linear_acc.z
+ ,t.read_ms());
+ pc.printf("Time:,%d,/",t.read_ms());
+ TimeStamp = Time;
+ }
}
}
}
@@ -225,7 +236,6 @@
// gravity.x, gravity.y, gravity.z);
//
// pc.printf("Time:,%d,\r\n",t.read_ms());
-
// imu.get_Euler_Angles(&euler_angles);
// pc.printf("[E],Y,%+6.1f,R,%+6.1f,P,%+6.1f,",
// euler_angles.h, euler_angles.r, euler_angles.p);
