chprintf float Topic is solved

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

Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

chprintf float

Postby tfAteba » Mon Aug 28, 2017 11:08 pm

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.
regards,

Theo.

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: chprintf float

Postby Giovanni » Tue Aug 29, 2017 7:20 am

Hi,

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

Giovanni

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: chprintf float

Postby tfAteba » Tue Aug 29, 2017 7:42 am

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.
regards,

Theo.

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: chprintf float  Topic is solved

Postby tfAteba » Sat Sep 02, 2017 12:00 am

Problem resolved, thanks.
regards,

Theo.


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 10 guests