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.
19 lines
367 B
19 lines
367 B
4 years ago
|
from easytello import tello
|
||
|
from TelloModule import TelloModule
|
||
|
|
||
|
drone = tello.Tello()
|
||
|
mod = TelloModule()
|
||
|
|
||
|
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()
|