title: How to send float over serial
body: <p>What's the best way to send <code>float</code>, <code>double</code>, and <code>int16</code> over serial on Arduino?  </p>
  
  <p>The <code>Serial.print()</code> only sends values as <a href="http://en.wikipedia.org/wiki/ASCII" rel="noreferrer">ASCII</a> encoded. But I want to send the values as bytes. <code>Serial.write()</code> accepts byte and bytearrays, but what's the best way to convert the values to bytes? </p>
  
  <p>I tried to cast an <code>int16</code> to an <code>byte*</code>, without luck. I also used memcpy, but that uses to many CPU cycles. Arduino uses plain C/C++. It's an <a href="http://www.atmel.com/devices/atmega328.aspx" rel="noreferrer">ATmega328</a> microcontroller.</p>