Shop OBEX P1 Docs P2 Docs Learn Events
sending floatstrings serially — Parallax Forums

sending floatstrings serially

seadog13seadog13 Posts: 9
edited 2009-02-04 15:16 in Propeller 1
Hey all, I have two processors sending and receiving strings. I have some sensor data that is a floatstring. I have not figured out how to send floatstrings across. Any ideas?

I thought I could send them as a string, and then turn them back into floats on the other processor. When I do that i get a number like 1.407e-20 when I could be rxing 3.5.

Thanks in advance.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-04 15:16
    You need to supply more information. You can send floating point data as strings from one Propeller to another and convert from float to string, then back again. You can also just send the binary information as 4 bytes. If your floating point value is stored in X, you could do something like this:
    repeat i from 0 to 3
       ser.tx(X.byte[noparse][[/noparse] i ])
    


    and you'd have something similar on the receive end.
Sign In or Register to comment.