Problem parsing floats with sscanf()

One big problem I am having is parsing the CSV string. From the documentation on the internet sscanf() allows me to parse a string, however, it only seems to work when I try to parse a CSV containing values which are integer and it doesn't work when parsing values that are float

This is the line of code

sscanf(buffer, "%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f", &gyro_roll, &gyro_pitch,&gyro_yaw,&accel_roll,&accel_pitch,&accel_z,&roll_err,&pitch_err, &roll_angle, &pitch_angle, &yaw_angle);

buffer is the line of CSV received for example "1.2,0.0,3.0,4.0,5.50,60.5,7.0,80.2,90.2,100.1,110.0"
all variables are of type float

If I replace the %f with %d and make all values and variables integer it works fine.

I don't think floating point conversions are enabled by default for the scanf functions. From memory you need to explicitly include an extended library in the gcc link stage... I've never tried that with the Arduino IDE, but it's probably just a short Google away to discover the magic.

Cheers,

It's mentioned in the embedded gcc docs...

hardware/tools/avr/doc/avr-libc/group__avr__stdio.html

Under vscanf (which sscanf uses):

By default, all the conversions described above are available except the floating-point conversions and the width is limited to 255 characters. The float-point conversion will be available in the extended version provided by the library libscanf_flt.a. Also in this case the width is not limited (exactly, it is limited to 65535 characters). To link a program against the extended version, use the following compiler flags in the link stage:

-Wl,-u,vfscanf -lscanf_flt -lm