1 /* Encodes a float value into a double on the wire.
2 * Used to emit doubles from AVR code, which doesn't support double directly.
7 #include "double_conversion.h"
8 #include "doubleproto.pb.h"
12 AVRDoubleMessage message = {
13 float_to_double(1234.5678f),
14 float_to_double(0.00001f)
18 pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer));
20 pb_encode(&stream, AVRDoubleMessage_fields, &message);
21 fwrite(buffer, 1, stream.bytes_written, stdout);