-
Notifications
You must be signed in to change notification settings - Fork 0
/
airbrakes_test.py
30 lines (28 loc) · 1.03 KB
/
airbrakes_test.py
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
from airbrake import airbrake
ab = airbrake()
char = 'z'
choice = input("Welcome to the airbrake test function! What would you like? \n 1. Read from sensors\n 2. Servo Control\n")
if(choice == '1'):
while(char != 'q'):
char = input("a for accelerometer, b for barometer, m for magnitude of acceleration, d for launch detection, q to quit\n")
if(char == 'a'):
while True:
print(ab.get_accel_mag())
elif(char == 'b'):
while True:
print(ab.get_altitude())
elif(char == 'm'):
while True:
print(str(ab.get_accel_mag()) + "\r")
elif(char == 'd'):
while True:
print(str(ab.detect_launch()) + "\r")
elif(choice == '2'):
while(char != 'q'):
char = input("q for quit, o for open, c for close\n")
if(char == 'o'):
print("opening airbrakes\n")
ab.deploy_airbrakes()
elif(char == 'c'):
print("closing airbrakes\n")
ab.retract_airbrakes()