Re: 16-bit value in 3 bytes?



On Jul 25, 10:12 pm, Andre-John Mas <andrejohn....@xxxxxxxxx> wrote:
On Jul 25, 3:12 pm, Andre-John Mas <andrejohn....@xxxxxxxxx> wrote:

Hi,

I recently got myself a 'Spaceball 5000' and since there is no driver
for my platform, I am trying to reverse engineer the protocol. The
place where I am stuck is that a given value for a rotation is
represented as a 16-bit signed integer, using four bytes. From what I
can tell the first byte represents the sign and the remaining 3 bytes
are used to encode the value using the characters ".023569:<?
ABCDEGHKLMNPSenors", so no more than 7 bits are used in each 8 bit
value. Additionally the first of the four bytes either has a value H
or G, which I believe might represent the sign.

Can anyone help me working out how the 16-bit value is being encoded?
Is there a better place to ask this question?

To provide an example, here are a sequence of packets. The first
character is the packet type and the following bytes represent x,y,z,
x rotation, y rotation and z rotation.

dH000H000H000H000H000H000
dH000H000H000H000H000G??:
dH000H000H000H000H000G?NM
dH000H000H000H000H000G?<M
dH000G???H000H000H000G?KB
dH000G?NGH000H000H000G?65
dH00KG?<KH00HH000H000GNNN
dH00KG?MKH00HH0AGH000GN9N
dH00<G?M9H00BH0BBH000GN9<
dH00<G?M9H00BH0BBH000GN9<
dH00MG?M9H00DH0BBH000GN9<
dH00MG?M9H00KH0BBH000GN9<
dH00NG?<BH00DH00MH006GN:K
dH000G?MMH000H000H006G?6H
dH000H000H000H000H000G??5
dH000H000H000H000H000H00K

The H000 value indicate 0,  since when at rest the value returned is:

dH000H000H000H000H000H000

Andre

You need to show us a hexadecimal dump. The question marks are values
that don't have ASCII equivalents.
.



Relevant Pages

  • Re: List rotation
    ... That is usually what people refer to as list rotation. ... the characters' ordinal values by one along some rotated list: ... character in the rotation alphabet and store the result in a translation ...
    (comp.lang.python)
  • Re: Where the Pena apologists at...?
    ... I hated the trade from the day it was made and things ... both a better hitter and fielder every day since he came here? ... What I predicted was that at least one of our 4 question marks in the ... starting rotation would go down to injury and we would need Arroyo's ...
    (alt.sports.baseball.bos-redsox)
  • Re: Its called KARMA, folks.
    ... went on the DL very early, and Then Wake later on. ... huge question marks in the starting rotation in March. ... When the Red Sox traded Arroyo for Pena, they were announcing to the world ...
    (alt.sports.baseball.bos-redsox)