Join us at IRC!
The measure of a mans life is not how well he dies, but how well he lives.
Friday, May 25, 2012
Navigation
Members Online
Total Online: 31
Web Spiders: 14
Guests Online: 30
Members Online: 1

Registered Members: 70209
Newest Member: KalareShou
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Page 2 of 2 < 1 2
Author

RE: Python+Microcontroller=Mouse

wolfmankurd
Member



Posts: 1519
Location: UK
Joined: 30.05.05
Rank:
God
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?


BY READING MY POST, YOU ACCEPT IT AS IS AND AGREE TO MY DISCLAIMER OF ALL WARRANTIES, EXPRESS OR IMPLIED, AS WELL AS DISCLAIMERS OF ALL LIABILITY, DIRECT, INDIRECT, CONSEQUENTIAL OR INCIDENTAL, THAT MAY ARISE FROM THE USE OF THIS (MIS)INFORMATION.


Widowmakr@hotmail.com http://LetsHackStuff.com
Author

RE: Python+Microcontroller=Mouse

techb
Member



Posts: 384
Location:
Joined: 15.02.09
Rank:
Hacker Level 2
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.


kbcarte.wordpress.com
Author

RE: Python+Microcontroller=Mouse

wolfmankurd
Member



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


BY READING MY POST, YOU ACCEPT IT AS IS AND AGREE TO MY DISCLAIMER OF ALL WARRANTIES, EXPRESS OR IMPLIED, AS WELL AS DISCLAIMERS OF ALL LIABILITY, DIRECT, INDIRECT, CONSEQUENTIAL OR INCIDENTAL, THAT MAY ARISE FROM THE USE OF THIS (MIS)INFORMATION.


Widowmakr@hotmail.com http://LetsHackStuff.com
Author

RE: Python+Microcontroller=Mouse

techb
Member



Posts: 384
Location:
Joined: 15.02.09
Rank:
Hacker Level 2
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.parallax.com/dl/docs/prod/acc/memsickit.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.




kbcarte.wordpress.com
Author

RE: Python+Microcontroller=Mouse

techb
Member



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


kbcarte.wordpress.com
Author

RE: Python+Microcontroller=Mouse

wolfmankurd
Member



Posts: 1519
Location: UK
Joined: 30.05.05
Rank:
God
Posted on 21-03-10 13:18
Yeah thanks :)
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).


BY READING MY POST, YOU ACCEPT IT AS IS AND AGREE TO MY DISCLAIMER OF ALL WARRANTIES, EXPRESS OR IMPLIED, AS WELL AS DISCLAIMERS OF ALL LIABILITY, DIRECT, INDIRECT, CONSEQUENTIAL OR INCIDENTAL, THAT MAY ARISE FROM THE USE OF THIS (MIS)INFORMATION.




Edited by wolfmankurd on 21-03-10 13:29
Widowmakr@hotmail.com http://LetsHackStuff.com
Author

RE: Python+Microcontroller=Mouse

goluhaque
Member



Posts: 194
Location: India
Joined: 17.02.10
Rank:
Hacker Level 1
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
Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.