Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling printf style output method with variadic arguments #29

Closed
wants to merge 1 commit into from
Closed

Enabling printf style output method with variadic arguments #29

wants to merge 1 commit into from

Conversation

aentinger
Copy link
Contributor

Usage example:

void setup() {
  Serial.begin(9600);
}

static int loop_cnt = 0;

void loop() {
  Serial.printf  ("[%d] ", millis()); 
  Serial.printfln("Loop Cnt %d", loop_cnt);
  loop_cnt++;
  delay(1000);  
}

Output:

[0] Loop Cnt 0
[999] Loop Cnt 1
[199] Loop Cnt 2
...

The function can't be named print because in this case its signature overlaps with size_t print(const char[]) (No variadic arguments is a legimitate use case).

@aentinger aentinger marked this pull request as ready for review March 19, 2019 12:02
@CLAassistant
Copy link

CLAassistant commented Apr 9, 2021

CLA assistant check
All committers have signed the CLA.

@matthijskooijman
Copy link
Collaborator

This seems like a duplicate of #28, which IMHO has a better implementation that has no fixed-size buffer. So I'm going to go ahead and close this PR, to keep things a bit more tidy (also since this feature is a bit controversial, as discussed in #32 and #28).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants