Hello, i'm trying make a start and stop basic like in automation. I have this code for do, and my problem is, i need do someone condition in same if for example this:
if (pin1 = true) and pin2 = true) or (pin1 = true and pin9 = true))
How do i make this?
Thanks and excuse me my english.
No need to apologize for anything HERE.
You create " compound condition "
if( (pin1 && pin2) || ( pin1 && pin9))
of course you replace the pinX with digitalRead(pinX)
The parentheses are strictly not necessary , but makes code more readable / user friendly .
You could get more creative knowing that "compound condition " is evaluated "from left to right" and the evaluation is terminated when true.
In your case - pin9 will not be checked if pins 1 and 2 are true.
Have fun coding.