Crates.io | e_drone_rpi |
lib.rs | e_drone_rpi |
version | 22.1.1 |
source | src |
created_at | 2021-02-22 06:05:47.144757 |
updated_at | 2022-01-05 03:30:47.218319 |
description | Rust library for BYROBOT Drones. |
homepage | https://github.com/byrobot-rust/e_drone_rpi |
repository | https://github.com/byrobot-rust/e_drone_rpi |
max_upload_size | |
id | 358812 |
size | 39,325 |
Rust library for BYROBOT drones.
Tested
Support
[dependencies]
e_drone_rpi="21.*"
e_drone="21.*"
extern crate e_drone_rpi;
use e_drone::system::{*};
use e_drone::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/e_drone_rpi/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