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

Open
wants to merge 1 commit into
base: master
from

Conversation

@aentinger
Copy link
Contributor

@aentinger aentinger commented Mar 19, 2019

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 Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.