diff options
author | Diego Barrios Romero <eldruin@gmail.com> | 2018-11-21 08:18:16 +0100 |
---|---|---|
committer | Diego Barrios Romero <eldruin@gmail.com> | 2018-11-21 08:18:16 +0100 |
commit | 2dec94ba529111e396c8b8c2b49de48084826eba (patch) | |
tree | 82e0bc8d0272ad2cd1e69a431ee8b3561f8aed3c /src | |
parent | 66e83785a255a7934842c44c5b26e85651a87b8a (diff) | |
download | ads1x1x-async-2dec94ba529111e396c8b8c2b49de48084826eba.tar.gz ads1x1x-async-2dec94ba529111e396c8b8c2b49de48084826eba.tar.xz ads1x1x-async-2dec94ba529111e396c8b8c2b49de48084826eba.zip |
Add example of reading measurement in continuous mode
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -133,7 +133,7 @@ //! # } //! ``` //! -//! ### Change into continuous conversion mode +//! ### Change into continuous conversion mode and read the last measurement //! //! ```no_run //! extern crate linux_embedded_hal as hal; @@ -145,9 +145,15 @@ //! let address = SlaveAddr::default(); //! let adc = Ads1x1x::new_ads1013(dev, address); //! let mut adc = adc.into_continuous().unwrap(); +//! adc.start().unwrap(); +//! while(!adc.is_measurement_in_progress().unwrap()) { +//! // some delay... +//! } +//! let measurement = adc.read().unwrap(); //! # } //! ``` //! +//! //! ### Set the data rate //! For 12-bit devices, the available data rates are given by `DataRate12Bit`. //! For 16-bit devices, the available data rates are given by `DataRate16Bit`. |