Function robust_arduino_serial::write_i16 [] [src]

pub fn write_i16<T: Write>(file: &mut T, num: i16) -> Result<usize>

Write two bytes int to a file/serial port. It returns the number of bytes written

Example

use std::io::Cursor;
use robust_arduino_serial::*;

let mut buffer = Cursor::new(Vec::new());
let number: i16 = 366;

// write 16 bits (two bytes) to the buffer
write_i16(&mut buffer, number).unwrap();