-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathamandaTest1.py
More file actions
98 lines (84 loc) · 2.34 KB
/
amandaTest1.py
File metadata and controls
98 lines (84 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
###############################################################################
#
# Amanda Ward
# This is code to test Devin Driggs's API
###############################################################################
import mavlinkinterface
import time
MLI = mavlinkinterface.mavlinkInterface('queue')
MLI.arm()
# the light test worked :)
def testLights():
MLI.setLights(50, execMode='synchronous')
# Turns the lights off
time.sleep(7)
MLI.setLights(100, execMode='synchronous')
# sets the lights to 65% brightness
time.sleep(7)
MLI.setLights(brightness=0, execMode='synchronous')
# sets the lights to full brightness
time.sleep(10)
MLI.setLights(brightness=100, execMode='synchronous')
# the light test worked :)
def gradualLightUp():
MLI.setLights(0)
# Turns the lights off
time.sleep(3)
MLI.setLights(10)
# sets the lights to 65% brightness
time.sleep(3)
MLI.setLights(brightness=20)
# sets the lights to full brightness
time.sleep(3)
MLI.setLights(brightness=30)
time.sleep(3)
MLI.setLights(brightness=40)
time.sleep(3)
MLI.setLights(brightness=50)
time.sleep(3)
MLI.setLights(brightness=60)
time.sleep(3)
MLI.setLights(brightness=70)
time.sleep(3)
MLI.setLights(brightness=80)
time.sleep(3)
MLI.setLights(brightness=90)
time.sleep(3)
MLI.setLights(brightness=100)
# the light test worked :)
def gradualLightDown():
MLI.setLights(100)
# Turns the lights off
time.sleep(3)
MLI.setLights(90)
# sets the lights to 65% brightness
time.sleep(3)
MLI.setLights(brightness=80)
# sets the lights to full brightness
time.sleep(3)
MLI.setLights(brightness=70)
time.sleep(3)
MLI.setLights(brightness=60)
time.sleep(3)
MLI.setLights(brightness=50)
time.sleep(3)
MLI.setLights(brightness=40)
time.sleep(3)
MLI.setLights(brightness=30)
time.sleep(3)
MLI.setLights(brightness=20)
time.sleep(3)
MLI.setLights(brightness=10)
time.sleep(3)
MLI.setLights(brightness=0)
# I tested the gripper functions and they do not work
def gripperOpen():
MLI.gripperOpen(1)
# not sure how long to make gripper open!
def gripperClose():
MLI.gripperClose(1)
# The grabber arm closes for 1/2 second
# gradualLightDown()
# gradualLightUp()
gripperOpen()
# gripperClose()