title: AVR: if statement
body: <p>I am new in AVR programming. I would like to control a variable (<code>uint8_t received_msg</code>) if it is equal to <code>0xFF</code>. would it be correct to do:</p>
  
  <pre><code>if (!(received_msg ^ 0xFF))
  </code></pre>
  
  <p>or  do I need to compare bit by bit</p>
  
  <pre><code>    uint8_t test = 0;
      test = received_msg ^ 0xFF 
      for (i =0; i&lt;8; i++){
       test = 0 &amp; (1&lt;&lt;received_msg)
      }
      if(test==0)
  </code></pre>