Utils  1.0.2
Utility functions and macros to print with arguments
Utils.cpp File Reference
#include <Utils.h>

Functions

void myPrintf (const char *sFmt,...)
 Print formatted data (equivalent to standard C printf) to the default Serial port. More...
 
void myPrintf (const String &sFmt,...)
 Print formatted data (equivalent to standard C printf) to the default Serial port. More...
 
void myPrintf (Print &pr, const char *sFmt,...)
 Print formatted data (equivalent to standard C printf) to a Print object. More...
 
void myPrintf (Print &pr, const String &sFmt,...)
 Print formatted data (equivalent to standard C printf) to a Print object. More...
 
char * format (const char *sFmt,...)
 Print formatted data (equivalent to standard C printf) to a C string. More...
 

Function Documentation

◆ format()

char* format ( const char *  sFmt,
  ... 
)

Print formatted data (equivalent to standard C printf) to a C string.

Writes the C string pointed by sFmt to a C string

If format includes format specifiers (subsequences beginning with %), the additional arguments following format are formatted and inserted in the resulting string replacing their respective specifiers.

Parameters
sFmtArduino String object that contains the text to be written to Serial
Returns
the formated string. Caller must delete the returned value in order to free allocated memory

◆ myPrintf() [1/4]

void myPrintf ( const char *  sFmt,
  ... 
)

Print formatted data (equivalent to standard C printf) to the default Serial port.

Writes the C string pointed by sFmt to the Serial port.

If format includes format specifiers (subsequences beginning with %), the additional arguments following format are formatted and inserted in the resulting string replacing their respective specifiers.

Parameters
sFmtC string that contains the text to be written to the default Serial port

◆ myPrintf() [2/4]

void myPrintf ( const String &  sFmt,
  ... 
)

Print formatted data (equivalent to standard C printf) to the default Serial port.

Writes the Arduino String object sFmt to the Serial port.

If format includes format specifiers (subsequences beginning with %), the additional arguments following format are formatted and inserted in the resulting string replacing their respective specifiers.

Parameters
sFmtArduino String object that contains the text to be written to the default Serial port

◆ myPrintf() [3/4]

void myPrintf ( Print &  pr,
const char *  sFmt,
  ... 
)

Print formatted data (equivalent to standard C printf) to a Print object.

Writes the C string pointed by sFmt to a Print object such as a Serial port or a display that "implements" the Print interface.

If format includes format specifiers (subsequences beginning with %), the additional arguments following format are formatted and inserted in the resulting string replacing their respective specifiers.

Parameters
prArduino Print object that suports the print and println methods
sFmtArduino String object that contains the text to be written to the Print argument

◆ myPrintf() [4/4]

void myPrintf ( Print &  pr,
const String &  sFmt,
  ... 
)

Print formatted data (equivalent to standard C printf) to a Print object.

Writes the Arduino String object sFmt to a Print object such as a Serial port or a display that "implements" the Print interface.

If format includes format specifiers (subsequences beginning with %), the additional arguments following format are formatted and inserted in the resulting string replacing their respective specifiers.

Parameters
prArduino Print object that suports the print and println methods
sFmtArduino String object that contains the text to be written to the Print argument