Skip to content

Commit

Permalink
Update Print.cpp
Browse files Browse the repository at this point in the history
Added printf
size_t printf(const char[], ...); implementation
  • Loading branch information
bonezegei committed Mar 12, 2024
1 parent 20c26bc commit 15699d4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cores/arduino/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,17 @@ size_t Print::printFloat(double number, uint8_t digits)

return n;
}

//added by bonezegei
size_t Print::printf(const char c[], ...){
char text[64];
va_list ap;

if (c == NULL)
return 0;
va_start(ap, c);
vsprintf(text, c, ap);
va_end(ap);

return write(text);
}

0 comments on commit 15699d4

Please sign in to comment.