Hello everybody. Any feedback will be very much appreciated.
Let's say we want to check if two input pins are high (e.g.PC5 and PC6)and then do something. I wrote something like this:
if (gpr1 & 0b01100000)
When this runs, that the program "does something" if PC5 OR PC6 is high, instead of PC5 AND PC6 being both high. Why this happens? How should I write the code to get what I really want? I would also appreciate any example on multiple/complex "if condition". e.g if (((PC5 AND PC7) ANDNOT PA4) OR PA3) ANDNOT gpr1=0xfa, do something. Thanks in advance for your feedback.