diff --git a/README.md b/README.md index 9992303..bd23d92 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,20 @@ vehicle. ## Usage ```rs -use obd2::{commands::Obd2DataRetrieval, device::Elm327, Obd2}; +use obd2::{commands::Obd2DataRetrieval, device::{Elm327, FTDIDevice}, Obd2}; fn main() -> Result<(), obd2::Error> { - let mut device = Obd2::::default(); + let mut device = Obd2::>::new(Elm327::new(FTDIDevice::new()?)?)?; println!("VIN: {}", device.get_vin()?); Ok(()) } ``` +alternatively, you could use a serial port provided by your operating system such as +/dev/ttyUSB0 on unix-like systems + +``` +let mut device = Obd2::>::new(Elm327::new(SerialPort::new("/dev/ttyUSB0")?)?)?; +``` + See the docs for more: https://docs.rs/obd2/