View Single Post
Old 01-12-2007, 04:16 AM   #26
sama
FLAC
sama's CarPC Specs
 
sama's Avatar
 
Join Date: Feb 2006
Location: London, UK
Vehicle: BMW 850CSi
Posts: 1,280
My Photos: ()
@turbocar & cherrybomb
I guess some more explanation is in order!

Turbo, that was a good and close guess!

I've copied some stuff from the top here to make it easier to see.

Code:
[0] [1] [2] [3] [4] [5] [6] 1 8 0 161 255 251 255 [0] [1] [2] [3] [4] [5] [6] 2 245 255 0 0 238 255 [0] [1] [2] [3] [4] [5] [6] 3 2 0 0 0 0 0


The 0'th element is the data descriptor, whcih describes the rest of the data. The data is actually interleaved.

So when the id is 1, the elements are:

1&2 are for pan left/right
3&4 for pan fwd/back
5&6 push/pull

and when the id is 2

1&2 tilt fwd/back
3&4 tilt left/right
5&6 twist left/right


and when the id is 3

the second element is either 1, 2 or 3 to repspecively indicate left button, right button, or both.


Now we can see that each axis is described by two values. The first always gives the value, and the second gives the sign (+/-)

So taking an example from the table:

Code:
pan left/right axis value from 1[1] right: 2[1] = 0 left : 2[1] = 255

this means the value for the axis is extracted from element 1 (0-255).
if going right, then element 2, which is the sign would be 0, and if going left, element 2 would be 255.
Finally, if the sign is 0, the the value would increase from 0-255. If the sign is 255, then the value would decrease from 255-0.



And now for the problem I've found . I've noticed that pushing beyond 255, actually starts the value again! It gets to 255, then starts at 0 again (the other way if the sign value is 255). It's like it has two lungs!

And the peculiar thing is, there are 7 bytes that come back, and the bytes do not change at all to indicate that the axis is on it's "second lung". I'm going to look deeper, and see perhaps if I'm missing anything, which I hope is the case. Otherwise, the only other thing I can think of is to keep track of climbs and falls (per axis) and to detect "second lungs" based on climbs and falls. This will be difficult since if you let go of the knob, it will return to 0 in a flash and probably bounce a bit too. It's a dirty solution basically and I can't imagine this is how they've done it.


@cherrybomb
I think I'll take this chance to finally learn C#. I'll get Visual Studio installed on here ASAP


@liquid
Ah, I didn't know that Exec was specific to RR. That sounds like a really good solution and would make things a lot easier to code. I guess Exec is a small bit of code that fires off a COM message and terminates.
__________________
///Mputer - Velocity - TomTom - Vision - Bezel - CarPC

Last edited by sama : 01-12-2007 at 04:36 AM.
sama is offline   Reply With Quote