Page 1 of 1

chprintf float

Posted: Mon Aug 28, 2017 11:08 pm
by tfAteba
Hi all,

I want to kown if any modification have been made to the chprintf library?
I want to print a float value like this: chprintf(chp, "\n\r: %.3f" 12.03456);
But I got an output to my console looking like this: " f"

Some time ago I was able to print float value with this code, but it does not work any more.
I have activated the library in the Makefile PRINTF_LIB = $(PRINTF_LIB_FLOAT)
My target board is Arduino Mega, and I use the trunk for this test.

Thanks for any hints and suggestions.

Re: chprintf float

Posted: Tue Aug 29, 2017 7:20 am
by Giovanni
Hi,

There is a switch to enable floats in chprintf(), see chprintf.h.

Giovanni

Re: chprintf float

Posted: Tue Aug 29, 2017 7:42 am
by tfAteba
Hi Giovanni,

I have not see that, thanks, I will active this and make a test tonight and see if it works. But I'm pretty sure that this was my problem.

Thanks.

Re: chprintf float

Posted: Sat Sep 02, 2017 12:00 am
by tfAteba
Problem resolved, thanks.