I have two push buttons and need to run some code if EITHER ONE or BOTH are pushed.
So, basically I need to know the correct syntax for doing this in an if statement.
I have something like this:
if (sensorValue1 and sensorValue2 == HIGH) {
//run this code}
else if (sensorValue1 or sensorValue2 == LOW {
//run this code}
I am aware this is incorrect syntax and just need someone to help me out with the correct syntax for this kind of condition.
That doesn't work. I think that it's not Arduino syntax to have the 'and' and 'or' there to seperate the two conditions? Someone please aware me on the correct syntax.
There is not really such a thing as "Arduino syntax". Arduino programs (sketches) are written in C/C++. Required reading here: http://arduino.cc/en/Reference/HomePage