You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tello_modules/test2.py

22 lines
381 B

from easytello import tello
from TelloModule import TelloModule
drone = tello.Tello()
mod = TelloModule('distance')
def main():
drone.takeoff()
while 1:
line = mod.get_block_dist()
if int(line[1]) > 400:
drone.forward(20)
if int(line[1]) < 300:
drone.back(20)
try:
main()
except KeyboardInterrupt:
drone.land()