FastLED 3.9.15
Loading...
Searching...
No Matches

◆ printf()

template<typename... Args>
void fl::printf ( const char * format,
const Args &... args )

Printf-like formatting function that prints directly to the platform output.

Parameters
formatFormat string with placeholders like "%d", "%s", "%f" etc.
argsArguments to format

Supported format specifiers:

  • d, i: integers (all integral types)
  • u: unsigned integers
  • f: floating point numbers
  • s: strings (const char*, fl::string)
  • c: characters
  • x: hexadecimal (lowercase)
  • X: hexadecimal (uppercase)
  • %%: literal % character

Example usage:

fl::printf("Value: %d, Name: %s", 42, "test");
fl::printf("Float: %.2f", 3.14159);
void printf(const char *format, const Args &... args)
Printf-like formatting function that prints directly to the platform output.
Definition printf.h:393

Definition at line 393 of file printf.h.

393 {
394 StrStream stream;
395 printf_detail::format_impl(stream, format, args...);
396 fl::print(stream.str().c_str());
397}
const char * c_str() const
Definition str.h:326
const string & str() const
Definition strstream.h:51
void format_impl(StrStream &stream, const char *format)
Definition printf.h:326
void print(const char *str)
Definition io.cpp:49
corkscrew_args args
Definition old.h:150

References args, fl::StrN< SIZE >::c_str(), fl::printf_detail::format_impl(), print(), and fl::StrStream::str().

+ Here is the call graph for this function: