From 7bd01a81e73c7234b69fc8dd66b80de902625641 Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Fri, 24 Apr 2020 09:33:02 +0200 Subject: Fix imports and enhance documentation --- examples/typed.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/typed.rs b/examples/typed.rs index 1a2e1e7..22a2212 100644 --- a/examples/typed.rs +++ b/examples/typed.rs @@ -1,13 +1,15 @@ -// 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}, @@ -15,8 +17,7 @@ use ads1x1x::{ Ads1x1x, SlaveAddr, }; -use linux_embedded_hal::I2cdev; - +/// Type alias type Adc = Ads1x1x, Ads1115, Resolution16Bit, ads1x1x::mode::OneShot>; /// Read a single value from channel A. -- cgit v1.2.3-54-g00ecf