MPU-6050 HID, brainstorming for functional implementation.


I've been working on an MPU-6050 based mouse, using a 32u4 (pro-Micro). I've gotten as far as getting decent control across two-dimensions (the X and Y for the mouse), and have reached a point where I could certainly use some logical assistance in determining how to call the function. I need to do so without additional hardware, such that movement of the unit alone can be interpreted as either Mouse.move() info, or state info. Question being, how can this be done without my machine interpreting "up-down" changes as Mouse.move() Y-axis info?

Thanks for any suggestions.

Bill Hawes.

You have a third axis (Z), why not using that one for the additional information? It may help if you share your code with us.

Hi, and thanks. I've attached my code, a modification to Jeff Rowberg's example code, kudos to that guy for sure.

You're right that I have the Z-axis (in the instance the "pitch" axis, which feels more like a roll with my hardware setup), but I've run into several concerns therewith.

A) ... and perhaps most immediately, there seems to be a lot of datal "cross-over" inter-axially. I assume some of this helps keep the figures as stable as they are when used with Mr. Rowberg's MPU-6050 library, but as my four-dimensional (or dynamic three-dimensional math) could be improved upon significantly, I don't fully understand those workings. I'm still a relative beginner. Essentially, when I rotate around Z (which I am not comfortable calling an axis, as it is a rotary measurement, but I don't have a better word, maybe "field"), I get a lot of variance in my X- and Y- values, which of course need to be dynamically stable in order to place a cursor where the function is needed.

B) I would very much like to develop a prototype using the "Z-axis as button" suggestion, but once I do get the inter- (or perhaps preferably extra-) axial stability in order, my intention has been to use Z-rotation as a means to toggle "wheel mode" and "mouse/cursor mode" such that when in "wheel mode", a Y-rotation would scroll up and/or down a page.

C) I would also like very much for this design to be accessible to people with special needs, therefore, both stability as and "clickability" are crucial. As to the former, I'm confident it can be rectified, though I'm not sure how. As to the "click" function, I imagine a simple algorithm could be constructed to implement a click once cursor position has been stationary for a determined period of time.

At any rate, open to good suggestions on this one. Thanks so much for your help, it is sincerely appreciated.

ProMicro_6050_HID.ino (7.17 KB)

C) I would also like very much for this design to be accessible to people with special needs, therefore, both stability as and "clickability" are crucial.

Wait, designing a motion based mouse for people with special needs? Are you sure it's easier for someone with special needs to use a motion sensor vs a normal mouse? Interesting...

As for clicking, you can measure the total magnitude of the acceleration forces and if it ever gets above a threshold, you can say the person "clicked". Basically the mouse clicks if you hit it against a table or something.

Can you post a picture of that device? I have the impression, this isn't primarily a technical question but more a user interaction question. Please tell us also why there cannot be additional hardware (like a button).