Skip to content

Commit

Permalink
Fix imports and enhance documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
eldruin committed Apr 24, 2020
1 parent e69a5a6 commit 7bd01a8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions examples/typed.rs
@@ -1,22 +1,23 @@
// This example demonstrates how the `Ads1x1x` struct may
// look in a type signature.
// This example demonstrates the use of a type alias for the `Ads1x1x` struct
// to ease usage in signatures.

#[macro_use(block)]
extern crate nb;

use embedded_hal;
extern crate embedded_hal;
use embedded_hal::adc::OneShot;
use linux_embedded_hal;
extern crate linux_embedded_hal;
use linux_embedded_hal::I2cdev;

extern crate ads1x1x;
use ads1x1x::{
channel::SingleA0,
ic::{Ads1115, Resolution16Bit},
interface::I2cInterface,
Ads1x1x, SlaveAddr,
};

use linux_embedded_hal::I2cdev;

/// Type alias
type Adc = Ads1x1x<I2cInterface<I2cdev>, Ads1115, Resolution16Bit, ads1x1x::mode::OneShot>;

/// Read a single value from channel A.
Expand Down

0 comments on commit 7bd01a8

Please sign in to comment.