i have a motor forward and reverse. 2 buttons (A1 and A2) for forward one or the other and 2 buttons(B1 and B2) for reverse one or the other.
2 endswitches. C1 and C2
So the motor has to go forward when A1 or A2 is pressed and B1 and B2 are not pressed (LOW) and C1 is LOW
Compound statements can be difficult to interpret. It is often better to nest the tests to make the structure more obvious
Perhaps
if (A1 == HIGH || A2 == HIGH)
{
if (B1 == LOW && B2 == LOW && C1 == LOW)
{
//do something
}
}
Doing it that way allows you to put print statements between the groups of tests so that you can track operation of the code when debugging. It also pays to put the least likely tests first as then when it fails the program does not have to execute any more tests