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

Add "streaming" syntax support to Print class #180

Open
jfjlaros opened this issue Feb 4, 2023 · 3 comments · May be fixed by #181
Open

Add "streaming" syntax support to Print class #180

jfjlaros opened this issue Feb 4, 2023 · 3 comments · May be fixed by #181

Comments

@jfjlaros
Copy link

jfjlaros commented Feb 4, 2023

I wrote a couple of lines of helper code to allow for easy printing. If anyone is interested, I could incorporate it in Stream.h and open a pull request.

Usage:

int a {9};
int b {10};
Serial << "You have " << a << " out of " << b << " retries left.\n";
// Prints: "You have 9 out of 10 retries left."
Serial << makePair(1.2, 4) << ' ' << makePair(12, BIN) << '\n';
// Prints: "1.2000 1100"
@per1234 per1234 changed the title PR for easy printing? Add "streaming" syntax support to Print class Feb 4, 2023
@per1234 per1234 transferred this issue from arduino/ArduinoCore-avr Feb 4, 2023
@aentinger
Copy link
Contributor

Hi @jfjlaros ☕ 👋

Maybe you can prepare a PR for this? I might add though, that there's some possibility that this might never make it into the Arduino API (not my call though).

@jfjlaros
Copy link
Author

jfjlaros commented Feb 6, 2023

I can try, but this issue has been transferred to a repository that none of the cores I use depend on. So testing will be challenging.

@jfjlaros
Copy link
Author

jfjlaros commented Feb 6, 2023

PR #181 is more or less what I had in mind.

@aentinger aentinger linked a pull request Feb 7, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants