#![feature(alloc_system)]
extern crate alloc_system;
extern crate servo_pca9685;
extern crate tessel;
use servo_pca9685::ServoArray;
use tessel::Tessel;
use std::thread::sleep;
use std::time::Duration;
fn main() {
let (port_a, _) = Tessel::ports().unwrap();
let mut servos = ServoArray::new(port_a, false, false);
servos.connect().expect("Could not connect to servo array.");
println!("Turning servos... (Press CTRL + C to stop)");
loop {
println!("1");
servos.set_duty_cycle(1, 1.0);
sleep(Duration::from_millis(1000));
println!("2");
servos.set_duty_cycle(1, 0.0);
sleep(Duration::from_millis(1000));
}
}