1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#![crate_type = "lib"]
#![crate_name = "rust_gpiozero"]

//! A simple interface to GPIO devices with Raspberry Pi.
//!
//! This library is based on [GPIOZero](https://gpiozero.readthedocs.io/en/stable/index.html)
//! library.
//!
//! _Note: This is a work in progress. The library will eventually support `embedded-hal` based drivers_
//!
//!
//! The idea is to get started with physical computing using Rust with little coding
//! by hiding the underlying complexity.
//!
//! The library uses [BCM Pin numbering](https://pinout.xyz/)
//!
//! # Example : Blinking an LED
//!
//! ```no_run
//!
//! extern crate rust_gpiozero;
//! use rust_gpiozero::*;
//!
//! fn main() {
//!
//! // Create a new LED attached to Pin 17
//!
//! let mut led = LED::new(17);
//!
//! // blink the LED
//! // on_time: 2 seconds and off_time: 3 seconds
//!
//! led.blink(2,3);
//!
//! }
//! ```
//!
//!
//!  # Example : Wait for a Button Press
//!
//! ```no_run
//!
//! extern crate rust_gpiozero;
//! use rust_gpiozero::*;
//!
//! fn main() {
//! let button = Button::new(17);
//! button.wait_for_press();
//! println!("button pressed");
//!
//! }
//!
//! ```

extern crate sysfs_gpio;

#[cfg(nightly)]
extern crate embedded_hal as hal;

pub use self::output_devices::*;
pub use self::devices::*;
pub use self::traits::*;
pub use self::input_devices::*;
//pub mod led;
pub mod devices;
pub mod output_devices;
pub mod input_devices;
pub mod traits;