From 513c77d4419167a5fbc7b24d7845bc1230d400a6 Mon Sep 17 00:00:00 2001 From: Lucca Pirovano Date: Thu, 11 Jun 2026 14:07:42 -0400 Subject: [PATCH] ai genned some working test code --- flyupflydown.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 flyupflydown.py diff --git a/flyupflydown.py b/flyupflydown.py new file mode 100644 index 0000000..be9d769 --- /dev/null +++ b/flyupflydown.py @@ -0,0 +1,23 @@ +from codrone_edu.drone import * +import time + +drone = Drone() +drone.connect() # or drone.pair() if connect() doesn't work in your version + +# Take off and stabilize +drone.takeoff() +drone.hover(2) # wait a couple seconds to stabilize + +# Fly UP 1 foot (0.3m) at a moderate speed +drone.move_distance(0, 0, 0.3, 0.5) # x=0, y=0, z=+0.3m (up), speed=0.5 m/s + +# Hover briefly +drone.hover(1) + +# Fly DOWN 1 foot (0.3m) slowly +drone.move_distance(0, 0, -0.3, 0.3) # z=-0.3m (down), slower speed = 0.3 m/s + +# Land safely +drone.land() + +drone.disconnect() # or drone.close()