Skip to content

Document ternary operator #6247

Closed
Closed
@thedub2001

Description

@thedub2001

Hello I just discovered the the Serial.print() function can be used with conditional testing :

Serial.print(test ? "test=true" : "test=false");

If the "test" variable is true then the output will be :

test=true

If the "test" variable is false then the output will be :

test=false

I just thought this function could appear somewhere in the Serial.print() reference documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions