Read String

Hi everyone…i´m trying to do a read of the UART, am sending a String from a pic… and my Imp receive this string, but also i want converter this string in float value… this is what i have…
and the results what shows me the Logg… really hope you can help me!

First of all you should modify your PIC code to send a carriage return after each float, so that the imp can tell the difference between 20.8 and 0.82.

Then you need to modify your squirrel code to cope with the PIC sending more slowly than the imp receives; at the moment each call to readstring() is only returning one byte. Have a look at the readback() function in this UART article for an example of how to build up a string incrementally.

Once you have a string of the form “20.8” you can use string.tofloat() to convert it.

Thanks a lot!!! this information was very helpful!! Thanks Philmy for takin the time to read my question!