forked from e-nouri/pyDrone
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathesc-calibration.py
More file actions
41 lines (33 loc) · 966 Bytes
/
esc-calibration.py
File metadata and controls
41 lines (33 loc) · 966 Bytes
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
from motor import motor
motor1 = motor('m1', 17, simulation=False)
motor2 = motor('m1', 18, simulation=False)
motor3 = motor('m1', 25, simulation=False)
motor4 = motor('m1', 22, simulation=False)
motors = [motor1, motor2, motor3, motor4]
print('***Disconnect ESC power')
print('***then press ENTER')
res = raw_input()
try:
for mitour in motors:
mitour.start()
mitour.setW(100)
print('***Connect ESC Power')
print('***Wait beep-beep')
res = raw_input()
for mitour in motors:
mitour.start()
mitour.setW(0)
print('***Wait N beep for battery cell')
print('***Wait beeeeeep for ready')
print('***then press ENTER')
res = raw_input()
for mitour in motors:
mitour.start()
mitour.setW(10)
res = raw_input()
finally:
# shut down cleanly
for mitour in motors:
mitour.stop()
print ("well done!")
exit()