Jump to content
I2Cdevlib Forums

Recommended Posts

My question is simple. Is it possible to use the DMP output without using the interruptions method?

My goal is also simple. I'm trying to read 3D acceleration without gravity by taking advantage of the actual dedicated processor for that task.

I took the example that comes with the Jeff's library and got it complied and executed just perfectly. The thing is I don't want the interruption system because half I don't completely understand the code, half I need to take samples at a fixed rate. I'm pretty sure the DMP is way faster than my sampling rate, and even though it isn't, skipping a couple of random samples is not an issue in my project.

So it would be awesome if I could do just something like this (my imagination coming out now)

void loop() {
	mpu.dmpGetQuaternion(&q, fifoBuffer);
	mpu.dmpGetAccel(&aa, fifoBuffer);
	mpu.dmpGetGravity(&gravity, &q);
	mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);
	Serial.print(aaReal.x); // awfully printed just to make my point

to get acceleration without gravity using only a few functions.

Note: I already did the corresponding calibration to get my offsets.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...