XBee and the Propeller: malformed Binary received
flo
Posts: 38
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:
The receiving prop is listening and printing to the console:
The output I'm getting is:
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
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
Comments