[][src]Function w1_therm_reader::read_from_file

pub fn read_from_file(filename: &str) -> Result<i32>

Read from a file the temperature It takes a path as a String and returns an io::Result with the temperature in m°C or an Error.

Example

let temp = w1_therm_reader::read_from_file("assets/w1_ex.txt").unwrap();
assert_eq!(temp, -22187);