Add missing sleep to example
One has to sleep for the duration of the configured profile to read proper data. Closes #23.
This commit is contained in:
parent
f531e617d6
commit
1e9986d41c
1 changed files with 3 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
//! use hal::*;
|
||||
//! use std::result;
|
||||
//! use std::time::Duration;
|
||||
//! use std::thread::sleep;
|
||||
//!
|
||||
//! # mod hal {
|
||||
//! # use super::*;
|
||||
|
@ -64,9 +65,11 @@
|
|||
//! .with_run_gas(true)
|
||||
//! .build();
|
||||
//! dev.set_sensor_settings(&mut delayer, settings)?;
|
||||
//! let profile_duration = dev.get_profile_dur(&settings.0)?;
|
||||
//!
|
||||
//! // Read sensor data
|
||||
//! dev.set_sensor_mode(&mut delayer, PowerMode::ForcedMode)?;
|
||||
//! sleep(profile_duration);
|
||||
//! let (data, _state) = dev.get_sensor_data(&mut delayer)?;
|
||||
//!
|
||||
//! println!("Temperature {}°C", data.temperature_celsius());
|
||||
|
|
Loading…
Reference in a new issue