title: How to set bits in a byte variable (Arduino)
body: <p>My question would be Arduino specific, although if you know how to do it in C it will be similar in the Arduino IDE too.</p>
  
  <p>So I have 5 integer variables:</p>
  
  <p>r1, r2, r3, r4, r5</p>
  
  <p>Their value either 0 (off) or 1 (on).
  I would like to store these in a byte variable let's call it relays, not by adding them but setting certain bits to 1/0 whether they are 0 or 1.
  For example:</p>
  
  <p>1, 1, 0, 0, 1</p>
  
  <p>I would like to have the exact same value in my relay's byte variable, not
  r1+r2+r3+r4+r5 which in this case would be decimal 3, binary 11.</p>
  
  <p>Thanks!</p>