I have data coming in through a UART port, the data is in comma delimited format, and contains floating point values. The data is commands coming through a radio link, and processing them quickly is of importance.
A typical command may look as such:
with $ and ! being string delimiting characters.
Right now I need to get the transmitted float co-ordinate values into floats. I’m really buffled on how to do this. I must be blind but I can’t find a function to do so, and doing it in managed code would be terribly inefficient, as I have a constant stream of different commands using float values coming through.
One idea I’ve had is to split the value by the dot, parse into ints, divide the second value by 10^of the values length, and add it onto the first value. That still seems hacky - could somebody advise me as to a built in method for doing this?