edronesp

Rust library for BYROBOT drones.



Example

Cargo.toml

toml [dependencies] e_drone_sp="21.*" e_drone="21.*"



main.rs

```rust extern crate edronesp;

use edrone::system::{*}; use edrone::protocol::{}; use e_drone_sp::{};

fn main() { let mut drone: Drone = Drone::new("COM75"); // windows //let mut drone: Drone = Drone::new("/dev/ttyACM0"); // linux

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); }, _ => {}, } } ```



Examples in library


Source code

https://github.com/byrobot-rust/edronesp/tree/master/examples



Show in github1s.com



Clone Library

git clone https://github.com/byrobot-rust/e_drone_sp/



Run

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