If condition with 3 inputs

Hi,

If one of 3 inputs is high then a bool should be set High. When all buttons are released, the bool should be Low. I’ve tried this:

mybool = digitalRead(Button1) || digitalRead(Button2) || digitalRead(Button3);

But this does not seem to work. How can I fix this?

Thx!

How are the buttons wired ?
Any pulldown resistors in place ?

if(condition is met || 2nd condition is met || 3rd condition is met){
variable = …;
}

DangerToMyself:
if(condition is met || 2nd condition is met || 3rd condition is met){
variable = …;
}

Is this correct?

if(digitalRead(Button1) == HIGH || digitalRead(Button2) == HIGH || digitalRead(Button3) == HIGH ){
myBool = HIGH;

Because I don’t get a HIGH when one of these conditions are met?

ON3WVS:
Is this correct?

if(digitalRead(Button1) == HIGH || digitalRead(Button2) == HIGH || digitalRead(Button3) == HIGH ){
myBool = HIGH;

Because I don't get a HIGH when one of these conditions are met?

You must have screwed up somewhere else. Please read the "How to use this forum" post at the top of any of the boards for information on how to best get help here. Then come back and post a complete program that illustrates the problem.

When debugging problems with conditional statements it is handy to have the conditions in variables and to print them before the test. That way you can see whether the values are what you expect them to be

Hello,

I working on similar task, with 8 input, see if tips in that post helps you
check thread here

Check Inputs and Display in LCD - Thread