move/
move.rs

1extern crate tello_edu;
2
3use tello_edu::{Tello, Result};
4
5#[tokio::main]
6async fn main() {
7    fly().await.unwrap();
8}
9
10async fn fly() -> Result<()> {
11    let drone = Tello::new()
12        .wait_for_wifi().await?;
13
14    let drone = drone.connect().await?;
15
16    drone.take_off().await?;
17    drone.move_up(50).await?;
18    drone.move_down(50).await?;
19    drone.move_left(50).await?;
20    drone.move_right(50).await?;
21    drone.move_forward(50).await?;
22    drone.move_back(50).await?;
23    drone.land().await?;
24
25    Ok(())
26}