¿ªÔÆÌåÓý

Re: Help!


 

Sprintf(%f) and printf(%f) are both non-operative in the Arduino IDE.
Using them will not throw an error in compiles...they just don't do anything
in run-time.? This seems to be a built-in trap for programmers who are used
to having the full conversion capability of C and C++.
Other things like decimal, octal, etc. do work as expected.? It is only
the conversion of float to text that is broken.
_._


On Sun, Jun 25, 2017 at 8:18 PM, Vince Vielhaber <vev@...> wrote:
A year or so ago someone on the arduino forum told me that sprintf is there but turned off to conserve memory.? They told me what to do to get it to work but I never could get it to.

There's a package for formatting string buffers called PString, but I don't see it being as much use as a simple sprintf or snprintf.

Vince.



On 06/25/2017 09:27 PM, Arv Evans wrote:
Mark and Dr. Fred

Unless it has been fixed in the past few months, the built-in Arduino.h
does not
implement sprintf(%f).? It does not block...it just does nothing.? This
is a long-
standing bug in the Arduino IDE that the IDE developers do not see as a
problem.

Example of the problem:

|chartemperature[10];floattemp =10.55;sprintf(temperature,"%f
F",temp);Serial.println(temperature);|




Arv? K7HKL
_._


--
? Michigan VHF Corp.? ?? ?
? ? ? ? ? ? ? ? ? ? ? ? ?




Join [email protected] to automatically receive all group messages.