extern crate emergency_stop;

use emergency_stop::EmergencyStop;

use std::time::Duration;
use std::thread::sleep;
use std::sync::atomic::Ordering;

static GPIO_PORT_STOP: u8 = 25;

fn main() {
    let emergency_stop = EmergencyStop::new(GPIO_PORT_STOP).expect("Create Emergency Stop failed");

    println!("{:?}", emergency_stop);

    while !emergency_stop.state.load(Ordering::Relaxed) {
        sleep(Duration::new(1, 0));
    }

    println!("Stopped.");
}
