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: MPU9150_DMP MotorControl QuaternionMath SimpleIOMacros mbed
Fork of cool_step_new by
Diff: main.cpp
- Revision:
- 5:3953111e9476
- Parent:
- 4:7ccb10039316
- Child:
- 6:3bd16fdf0b6e
--- a/main.cpp Mon Apr 20 12:22:15 2015 +0000
+++ b/main.cpp Mon Apr 20 14:49:36 2015 +0000
@@ -17,10 +17,15 @@
Ticker infoTicker;
Vector3 eularAngles;
+Timer timer;
+Timer timer2;
+
char buffer[200];
void infoTask(void)
{
led1=!led1;
+ printf("%d\r\n",timer2.read_us());
+ timer2.reset();
}
int main()
@@ -38,20 +43,21 @@
imu.initialiseDMP();
- Timer timer;
timer.start();
+ timer2.start();
imu.setFifoReset(true);
imu.setDMPEnabled(true);
Quaternion q1;
while(1) {
+
if(imu.getFifoCount() >= 48) {
imu.getFifoBuffer(buffer, 48);
led2 = !led2;
}
- if(timer.read_ms() > 50) {
+ if(timer.read_ms() > 100) {
timer.reset();
//This is the format of the data in the fifo,
