title: Embedded C: Converting from uint16_t to float?
body: <p>So I am using an Atmega328p and a MCP9808 to take some i2c temp values. Im running it to my computer and viewing it in termial via USART.</p>
  
  <p>Im getting the correct values for Celsius degrees (it shows 00022, which is around 71 degrees which is correct for my room).</p>
  
  <p>However when I try to convert to fahrenheit I get values of 00054 which is def. not correct.</p>
  
  <p>This is the formula im using:</p>
  
  <pre><code>float fahrenheitConvert(uint16_t celsius) {
      float fahrenheit;
      fahrenheit = celsius*(9/5) + 32;
      return fahrenheit;
  }
  </code></pre>
  
  <p>celsius is simply a <code>uint16_t</code> value called "Temperature" in the main program (Which is what is printed out through serial just fine). Am I missing something? This seems like it should be a simple conversion?</p>