MPU9150 accidental accel/gyro toggling

By jcvanstuijvenberg , 31 August 2014

Hi,

I'm working on an undergrad research project developing smartphone apps that communicate with MotionFit Wireless units. We're collecting quaternion data to help us detect certain motions when the 9150 is worn by a user, but we'd like to collect accelerometer and gyroscope data as well.

Here's the problem: when there's a communication disruption between the smartphone and the 9150, as a part of the reconnection process the app winds up resending the "accelerometer" message (inv a) to the MPU, which has the unintended consequence of toggling the accelerometer readings off if accelerometer data is already being sent.

The apps we're developing are intended to be used by research volunteers, so we're trying to avoid any kind of complicated, manual in-app toggling process. We just want the app to toggle accelerometer data on if it's off, and do nothing if accelerometer data is already being sent.

Being students, we're a little short on experience and find working with the MPU9150...challenging. ;) Is there a simple way to handle conditional toggling of accelerometer/gyroscope data that we haven't discovered? Our best solution so far involves launching threads to keep track of various time stamps relating to the issuing of toggle commands, time of last packet received, etc. Is there a better way?

Many thanks!

phpbb Topic ID
16539