Skip to content

Add "streaming" syntax support to Print class #180

Open
@jfjlaros

Description

@jfjlaros

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"

Activity

changed the title [-]PR for easy printing?[/-] [+]Add "streaming" syntax support to Print class[/+] on Feb 4, 2023
aentinger

aentinger commented on Feb 6, 2023

@aentinger
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

jfjlaros commented on Feb 6, 2023

@jfjlaros
Author

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

jfjlaros commented on Feb 6, 2023

@jfjlaros
Author

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

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Add "streaming" syntax support to Print class · Issue #180 · arduino/ArduinoCore-API