title: Arduino - Covert to value to DEC HEX Value
body: <p>I have a serial event that reads a HEX byte. This is stored as INT representing the HEX value. I need to convert this back to a Dec value. </p>
  
  <p>Example:</p>
  
  <p>Serial is sent 0x20 - stored as INT 32 - I want to convert this to INT 20</p>
  
  <p>I have tried the following but it Prints OK but wont convert. How do I get it too.</p>
  
  <p>Sudo Code:</p>
  
  <pre><code>int from_ser;
  int new_value;
  Serial.println(from_ser); // Prints 32
  Serial.println(from_ser,HEX); // Prints 20 ( The value we want!)
  new_value = (from_ser,HEX);
  Serial.println(new_value); // Prints 16 - Why !!!
  </code></pre>
  
  <p>Thanks</p>