Add get_rpm and get_speed
This commit is contained in:
parent
4e8bfd38d1
commit
559fbbaa12
3 changed files with 54 additions and 5 deletions
|
@ -3,6 +3,8 @@
|
|||
mod obd2;
|
||||
use obd2::Obd2Device;
|
||||
|
||||
use std::time;
|
||||
|
||||
fn main() {
|
||||
env_logger::init();
|
||||
let mut device: obd2::Obd2<obd2::Elm327> = obd2::Obd2::default();
|
||||
|
@ -20,4 +22,10 @@ fn main() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
let state = time::Instant::now();
|
||||
while state.elapsed() < time::Duration::from_secs(5) {
|
||||
println!("RPM: {:?}", device.get_rpm());
|
||||
println!("Speed: {:?}", device.get_speed());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue