Hello palm-dev-forum world.

I'm trying to decode a bit stream sent from an unusual IR device which I'm
reading on the Palm. I have a small sample of data which I hope that if I
post here maybe someone can give me a clue about what's going on, and how I
can accurately read the signal.

In the following table, the first column represents the number I'm receiving
from the Palm, the last column (Target) is the number I _know_ I should be
getting.

Number  Binary    Complement         ShiftRight        Target
 245    11110101    10   00001010    5     00000101     5
  95    01011111   160   10100000   80     01010000    80
 247    11110111     8   00001000    4     00000100     7
 251    11111011     4   00000100    2     00000010     3
 253    11111101     2   00000010    1     00000001     1
 239    11101111    16   00010000    8     00001000     8

What I can't figure out is that, by complementing, and shift right, I get
accurate results for some of the values (245=5, 95=80, 253=1 and 239=8) but
for others (247=7, 251=3) I'm not.

I remember from the distant past, some technique that involved flipping the
first bit then depending on some condition, either flipping or not the
subsequent bits, but I can't recall any more detail.

I'd be grateful for any clues.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to