title: Combining three nibbles
body: <p>I'm working on a code that combines nibbles. I got one working where I combine two nibbles. However, I also need to combine three nibbles into one 12 bit. Does anyone know how to do this? Thanks!</p>
  
  <p>example: </p>
  
  <p>nibble 1: F</p>
  
  <p>nibble 2: 1</p>
  
  <p>nibble 3: 3</p>
  
  <p>The result is F31. </p>
  
  <p>EDIT:
  As others have requested, this is my two nibbles combiner:</p>
  
  <pre><code>unsigned int combineBytes(unsigned lowByte, unsigned highByte){
      unsigned int combinedByte;
      combinedByte = lowByte | (highByte &lt;&lt; 4);
      return (combinedByte);
  } 
  </code></pre>