Follow us on Twitter!
Your life is ending one minute at a time. If you were to die tomorrow, what would you do today?
Thursday, April 24, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 17
Guests Online: 15
Members Online: 2

Registered Members: 82889
Newest Member: Geriztul
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Page 2 of 2 < 1 2
Author

RE: Python+Microcontroller=Mouse


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 19-03-10 16:19
How comes it still needs to be above a certain value? Also do the values for between 0 and some figure with say 1500 being 0. or - to +ve?


Author

RE: Python+Microcontroller=Mouse

techb
Member



Posts: 384
Location:
Joined: 15.02.09
Rank:
Moderate
Posted on 19-03-10 17:29
It has to be above a threshold. The accelerometer values don't go below roughly 1500. There is no - values only +. If I didn't have the threshold, the mouse would move constantly. I needed a dead zone, hence the threshold.


www.userbars.com/74460/665255/337-7865-ubda3219.gif
kbcarte.wordpress.com
Author

RE: Python+Microcontroller=Mouse


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 19-03-10 18:01
Sorry to bombard you with questions, if you tilt the mouse does it drift due to gravity?


Author

RE: Python+Microcontroller=Mouse

techb
Member



Posts: 384
Location:
Joined: 15.02.09
Rank:
Moderate
Posted on 20-03-10 05:46
People wouldn't learn if they didn't ask questions. I don't think you could learn much from me though lol.

Its more about angle than gravity I guess.
This is the accelerometers data sheet.
http://www.parall. . .sickit.pdf


But I don't calculate g's; instead I base my calculations off of the pulse rate of the accelerometers two out-put pins.
If the pulse rate goes above a set threshold value, I take the deference of the value from the accelerometer and the threshold number
value-threshold.

If the rate goes below a threshold, I take the deference between the threshold and the accelerometer value threshold-value. That way it stays positive.

I divide the deference by 10 because it gives me more reasonable speed values. Because 2937 - 2600 = 337(actual test values). If I added 337 pixel values to the mouse position it will move 1/4 across my screen. And even then, people could be running at lower resolutions as me too(mines 1440 x 900). So if I divide 337 by 10 in python I get 33. I know 337/10 really is 33.7, but I'm using integers not floats.

The higher the tilt, the higher the deference, the higher the speed at which the mouse moves.




www.userbars.com/74460/665255/337-7865-ubda3219.gif
kbcarte.wordpress.com
Author

RE: Python+Microcontroller=Mouse

techb
Member



Posts: 384
Location:
Joined: 15.02.09
Rank:
Moderate
Posted on 21-03-10 03:52
Does that explain it?


www.userbars.com/74460/665255/337-7865-ubda3219.gif
kbcarte.wordpress.com
Author

RE: Python+Microcontroller=Mouse


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 21-03-10 13:18
Yeah thanks Smile
Though, it sounds like rather than moving the mouse you just tilt it? My not just move it?
Unless you actually move it it seems pointless to bother to integrate the acceleration.
My point wasthat you oculd then have it so if a mouse moved an inch the onscreen cursour would move similarly (though that'd be ineffecient).




Edited by on 21-03-10 13:29
Author

RE: Python+Microcontroller=Mouse

goluhaque
Member



Posts: 197
Location: India
Joined: 17.02.10
Rank:
Apprentice
Warn Level: 30
Posted on 15-04-10 08:24
Cool man! Keep it up.


That applause I receive from y'all on posting this post would have gotten me drunk on power if I hadn't already been high on life.
Page 2 of 2 < 1 2