Do i do the following?
Serial pc(USBTX, USBRX); tx, rx
int main(){
pc.sscanf (yourstring,"%f",&yourfloat);
}
I don't think the mbed has "sscanf" in the library for the pc.
I understand how to program in c on the computer (at least i did it for about 2 years ish). But it is the problem of doing it with mbed and communicating it in the serial port. I'm trying to read, write via the serial port.
now the current problem for me is to scan a string of 8characters(x.xxxxxx) and convert them into a floating point number that is useful for computing in mbed. If someone can help me out, that would be great. Sorry for not being more detail in my first post.
I'm not quite an experience programmer(especially in c), i tried to search on the forum for some help, but i couldn't find any.
This is probably a very simple thing. But can someone show me how would i go by printing a float as an array of characters?
Are functions like cout be used in programing mbed?
the second question is: How do i read an array of characters from the serial port and convert them back into a floating point number?
Much thanks!