943,165 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Marked Solved
  • Views: 556
  • Python RSS
Mar 15th, 2010
0

double integrating acceleration?

Expand Post »
I posted a snippet about using a microcontroller as a mouse, and it works great, but it moves the mouse as a stepper motion.

How would I go about making it velocity driven? Like when I tilt the accelerometer further, the faster the mouse moves. I've seen it on youtube, and looked at some source code for how they did it, but can't seem to figure it out.

The only way I would know how is a ton of if statments polling for higher values, and I know that wouldn't be the best way.

I've been told that double integrating the acceleration would be a good method, but have no idea how its done. I've been googeling for about 6 hours with no good examples or guides.

Thanks.
Similar Threads
Reputation Points: 59
Solved Threads: 33
Posting Whiz in Training
Tech B is offline Offline
268 posts
since May 2009
Mar 15th, 2010
0
Re: double integrating acceleration?
I don't think this is double intergration but I have the desired effects from using:
Python Syntax (Toggle Plain Text)
  1. ...
  2. if int(d[2]) > 2700:
  3. if x < 1400:
  4. x += (int(d[2])-2700)/10
  5. elif int(d[2]) < 2400:
  6. if x > 0:
  7. x -= (2400-int(d[2]))/10
  8. if int(d[5]) > 2600:
  9. if y > 0:
  10. y -= (int(d[5])-2600)/10
  11. elif int(d[5]) < 2400:
  12. if y < 900:
  13. y += (2400-int(d[5]))/10
  14. ...

Where int(d[2]) & int(d[5]) are the values from the accelerometer. And 2700, 2600, 2400 are the threshold values. 10 is the base speed.
I don't know what to call it, threshold deference maybe?
Last edited by Tech B; Mar 15th, 2010 at 9:50 pm.
Reputation Points: 59
Solved Threads: 33
Posting Whiz in Training
Tech B is offline Offline
268 posts
since May 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: Windows 7 64bit
Next Thread in Python Forum Timeline: Python reading Excel





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC