Shop OBEX P1 Docs P2 Docs Learn Events
XBee and the Propeller: malformed Binary received — Parallax Forums

XBee and the Propeller: malformed Binary received

floflo Posts: 38
edited 2009-09-29 07:33 in Propeller 1
Hey guys,

I'm trying to send numbers from one prop to another using a pair of XBees. Problem I'm having is that the binary received is missing the leading zeros. Here's what I'm doing:

One prop is simply outputting:
Prop 1 said...

repeat
XB.Dec(1)
waitcnt(cnt+40_000_000)
XB.Dec(2)
waitcnt(cnt+40_000_000)

The receiving prop is listening and printing to the console:
prop 2 said...

repeat
x := XB.Rx
term.str(Num.ToStr(x,NUM#BIN))


The output I'm getting is:
Console said...

...
110001
110010
110001
110010
...

Thing is, the proper binary for 1 and 2 are 00110001 and 00110010 respectively and if I ask the prop to display it as Decimals I get 49 and 50.

Where did those 2 leading zeros go?!

Thanks in advance and excuse any ignorance I may have: I'm a mechanical engineer trying to learn some electronics blush.gif

Comments

  • Forest GodfreyForest Godfrey Posts: 38
    edited 2009-09-29 07:33
    It looks like you're receiving just fine. The printing routines are stripping off the leading zero's.
Sign In or Register to comment.