| Author |
RE: Python+Microcontroller=Mouse |
wolfmankurd
Member

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

|
|
| Author |
RE: Python+Microcontroller=Mouse |
techb
Member

Posts: 384
Location:
Joined: 15.02.09 Rank: Hacker Level 2 |
|
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.
|
|
| Author |
RE: Python+Microcontroller=Mouse |
wolfmankurd
Member

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

|
|
| Author |
RE: Python+Microcontroller=Mouse |
techb
Member

Posts: 384
Location:
Joined: 15.02.09 Rank: Hacker Level 2 |
|
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.
|
|
| Author |
RE: Python+Microcontroller=Mouse |
techb
Member

Posts: 384
Location:
Joined: 15.02.09 Rank: Hacker Level 2 |
|
Does that explain it?
|
|
| Author |
RE: Python+Microcontroller=Mouse |
wolfmankurd
Member

Posts: 1519
Location: UK
Joined: 30.05.05 Rank: God |
|
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 |
|
| Author |
RE: Python+Microcontroller=Mouse |
goluhaque
Member

Posts: 194
Location: India
Joined: 17.02.10 Rank: Hacker Level 1 Warn Level: 30
|
|
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. |
|