title: How can I transform a int to a byte?
body: <p>I'm creating a temperature (Celsius) node for my Arduino. I'm sending byte data from my node to the master-node (also running Arduino) by cheap RF links so I need to convert a temperature (float) to a byte that Im sending over the air.</p>
  
  <p>I know that with a simple byte I'm limited by 255 values of a byte, but if I set the precision to 0.5 that will be more then good enough for there weather we are having. So I've set the range to [-30, 97]</p>
  
  <p>When that is set 0 degrees Celsius = byte value 60.</p>
  
  <pre><code>float ConvertFromByte(byte b)
  {
    // todo
  }
  
  byte ConvertFromFloat(float f)
  {
    // todo
  }
  </code></pre>
  
  <p>In the ConvertFromFloat I'll need to round to the nearest 0.5, and then apply the method of conversion. ConvertFromByte only has to to the last bit, but in reverse.</p>
  
  <p>How can I achieve this?</p>