how do i convert a float value into a 4byte array! Solved!
Anubisbot
Posts: 112
Hi i got stuck , and the search in the forum, turned out 0.
Ok i have my gps float numbers and need to send them over serial out via full duplex driver.
I know that a float can be packed in 4 bytes but how??
Is there a code example some where ??
best regards Anubisbot
Post Edited (Anubisbot) : 2/14/2009 1:19:11 AM GMT
Ok i have my gps float numbers and need to send them over serial out via full duplex driver.
I know that a float can be packed in 4 bytes but how??
Is there a code example some where ??
best regards Anubisbot
Post Edited (Anubisbot) : 2/14/2009 1:19:11 AM GMT
Comments
alternatively:
You can also use the FloatString object to convert the floating point number to a string like -23.56 and send that with FullDuplexSerial.
Post Edited (Mike Green) : 2/13/2009 9:31:29 PM GMT
i need to get the value fv what is a flaot into my
so how do i convert the float number into the 4 bytes ??
Best regards Anubisbot
and then i need to get the 4 bytes back to a float in c++ ???
Best regards
Jason
Post Edited (JasonDorie) : 2/13/2009 11:49:45 PM GMT
So in my c++ i need to join them them with memcpy() ?? hopefully.. Great thanx mike...
Thanx again[noparse]:)[/noparse]