#![feature(alloc_system)]
extern crate alloc_system;
extern crate climate_si7020;
extern crate tessel;
use climate_si7020::Climate;
use tessel::Tessel;
use std::thread::sleep;
use std::time::Duration;
use std::io::prelude::*;
fn main() {
let (mut port_a, _) = Tessel::ports().unwrap();
let mut climate = Climate::new(port_a);
climate.connect().expect("Could not connect to climate sensor.");
println!("Reading climate sensor... (Press CTRL + C to stop)");
loop {
println!("Temperature (Fahrenheit): {:?}", climate.read_temperature());
sleep(Duration::from_millis(100));
}
}