Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9a28c82

Browse files
author
holmdane
committed
2 parents e2d1cef + 527c931 commit 9a28c82

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

P2 - Project/Controller analyzer.py

100644100755
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
2-
31
import pygame
4-
from pygame.locals import*
2+
from pygame.locals import *
53
import time
6-
from djitellopy import Tello
4+
75

86
pygame.JOYBUTTONDOWN
97

@@ -15,13 +13,10 @@
1513
# Initialize the joysticks.
1614
pygame.joystick.init()
1715

18-
tello = Tello()
19-
tello.connect()
20-
time.sleep(3)
21-
tello.takeoff()
2216

2317
# -------- Main Program Loop -----------
2418
while not done:
19+
2520
# Get count of joysticks.
2621
joystick_count = pygame.joystick.get_count()
2722

@@ -43,10 +38,10 @@
4338
done = True
4439
quit()
4540
if event.button == 6:
46-
tello.takeoff()
47-
if event.button == 7:
48-
tello.land()
41+
print("start has been pressed")
4942

43+
if event.button == 7:
44+
print("select has been pressed")
5045
if event.type == JOYAXISMOTION:
5146
if (joystick.get_axis(0) > 0.5) or (joystick.get_axis(0) < -0.5):
5247
print("left thumbstock is moving left and right")

0 commit comments

Comments
 (0)