Re: 16-bit value in 3 bytes?
- From: Gene <gene.ressler@xxxxxxxxx>
- Date: Sun, 27 Jul 2008 13:58:23 -0700 (PDT)
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.
.
- References:
- 16-bit value in 3 bytes?
- From: Andre-John Mas
- 16-bit value in 3 bytes?
- Prev by Date: Re: core features and functions required in modern programming languages
- Next by Date: Re: Dynamic data structures
- Previous by thread: Re: 16-bit value in 3 bytes?
- Next by thread: RS 232C programming for NEC LCD 4620
- Index(es):
Relevant Pages
|