aboutsummaryrefslogtreecommitdiffstats
path: root/System/Tests/test_back_forth_10_times.py
blob: 3feaba4ad4ad98e10d59e7735ebed168a0967d2e (plain) (blame)
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
from pendulum import System
from time import sleep
        
# Main program
#print("before system()call")
sys = System()
#print("after system() call")
sys.initialize()
#print("after sys.inintalize called")

#Go back and forth 10 times

ang,lin = sys.measure()
print("Starting position before moving: " + str(lin))
sys.adjust(15)
ang,lin = sys.measure()
sleep(0.01)
counter = 0
while (counter < 10):
    
    sys.adjust(15)
    ang,lin = sys.measure()
    sleep(0.01)
    while lin < 12:
        ang,lin = sys.measure()
        sleep(0.01)
        sys.add_results(ang,lin,15)

    sys.adjust(-15)
    ang,lin = sys.measure()
    sleep(0.01)
    while lin > -12:
        ang,lin = sys.measure()
        sleep(0.01)
        sys.add_results(ang,lin,-15)
   
    counter += 1

sys.return_home()