Skip to main content
Associate II
Question

Not able to print Floating Values using STM8S103F3P.

I am doing a Current, Voltage Measuring project using INA219 Current Sensor and using STM8S103F3P Mini Development Board. And monitoring the data in Serial Monitor. But I am not able to read/write Floating Values. For Eg: Multimeter is measuring 21.28 mA then I am only getting 21 when I use int or long int. And if I use float then random symbols like "????" occurs in serial monitor.
What can I do to print floating values or how can I print values more precisely? 

    This topic has been closed for replies.

    1 reply

    Uwe Bonnes
    Chief

    Floating point needs lot of flash and you need to explicit enable it and link with additional libraries. Rad the docu of your compiler setup.