Ihr Ingenieurbüro für

Elektronik- und Softwareentwicklung

Using scanf and printf with floats with AVR Studio 6

Veröffentlicht:   |   Weitere Einträge über avr baremetal windows

To use floating point with AVR Studio 6 with functions from the scanf/printf family you have to link against the proper libraries and set the correct flags to make it work. Unfortunately the scanf settings aren't made available in the GUI like for printf.


You can download a test project: avr-scanf-float.zip


Add the following libraries to the libraries list:

  • libm
  • libscanf_flt
  • libprintf_flt
Setting up the libraries to link against

Enable Use vprintf library:

Enabling the vfprintf library

Add -Wl,-u,vfscanf to Other linker flags:

Enabling the vfscanf library
Comments powered by Disqus