Rust library for BYROBOT drones.
Tested
Support
toml
[dependencies]
e_drone_rpi="21.*"
e_drone="21.*"
```rust extern crate edronerpi;
use edrone::system::{*}; use edrone::protocol::{}; use e_drone_rpi::{};
fn main() { let mut drone: Drone = Drone::new(); // Raspberry PI UART //let mut drone: Drone = Drone::new_path("/dev/ttyACM0"); // Raspberry PI USB
if drone.is_connected() == false {
return;
}
drone.request(DeviceType::Controller, DataType::Information);
loop {
handler(&drone.check());
if drone.get_time_passed_from_last_transfer() > 1200 {
break;
}
}
}
fn handler(data: &Data) { match data { Data::Information(information) => { println!("{:?}", information); }, _ => {}, } } ```
https://github.com/byrobot-rust/edronerpi/tree/master/examples
git clone https://github.com/byrobot-rust/e_drone_rpi/
cargo run --example flight
cargo run --example button
cargo run --example buzzer
cargo run --example display
cargo run --example joystick
cargo run --example light
cargo run --example request
cargo run --example vibrator