Hello, i want to use || in ""if (input == output || green == red)""

What happens if both are true? will the result be true or false?

Or can the secondary be done somehow?

I using Clone of arduino Mega2560 (CH340G)

Hello, i want to use || in ""if (input == output || green == red)""

What happens if both are true? will the result be true or false?

Or can the secondary be done somehow?

I using Clone of arduino Mega2560 (CH340G)

If they're both true, the result is true. Try it.

Or look at an logical OR operator truth table . . .

A and B are inputs. Z is the output.

What do you mean by "secondary"?

There is no single logical XOR operator, only bitwise.

Do you confuse && AND and || OR?

|| is true when at least one argument is true.

Isn't this a coincidence and?

ok thx

Sorry. You are right. I copied the wrong table.

Hi,

I agree it is an AND

An OR would be.

A | B | Z |

0 | 0 | 0 |

0 | 1 | 1 |

1 | 0 | 1 |

1 | 1 | 1 |

XOR

A | B | Z |

0 | 0 | 0 |

0 | 1 | 1 |

1 | 0 | 1 |

1 | 1 | 0 |

Tom.....

Indeed. I used Google Image Search for an OR truth table and copied the first one I came across without looking at it. Thanks for adding a valid one.

In your OP, youâ€™re asking about the possibility of XOR occurring.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.