I have an if statement along the lines of if(AA==BB && CC==DD && FF==GG OR FF might==HH) In other words, one of the ANDs can return true from a choice of values (GG or HH).
I wrote it as
if(startByte==0x7E && lengthByteLSB>=12 &&calculatedID==0x40B31540|| calculatedID==0x40F90403 ||calculatedID==0x40C0E5F2 ||calculatedID==0x40B41623 ||calculatedID==0x40F90353)
For information, the IDs are XBee addresses, so if the startByte and lengthByteLSB are correct and the calculatedID is one of the five addresses, the if statement executes.
Or put it another way, is there an order of precedence for operators or should I be using brackets?
It seems to work OK
Thanks for any advice