chprintf float Topic is solved

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
User avatar
tfAteba
Posts: 551
Joined: Fri Oct 16, 2015 11:03 pm
Has thanked: 91 times
Been thanked: 50 times

chprintf float

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: chprintf float

Post by Giovanni »

Hi,

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

Giovanni
User avatar
tfAteba
Posts: 551
Joined: Fri Oct 16, 2015 11:03 pm
Has thanked: 91 times
Been thanked: 50 times

Re: chprintf float

Post 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.
User avatar
tfAteba
Posts: 551
Joined: Fri Oct 16, 2015 11:03 pm
Has thanked: 91 times
Been thanked: 50 times

Re: chprintf float

Post by tfAteba »

Problem resolved, thanks.
Post Reply