From f9223d201adda30d67fbf2af6b7c39b0be5a39c7 Mon Sep 17 00:00:00 2001 From: lake0112 Date: Thu, 24 Feb 2022 16:09:51 -0600 Subject: add a test --- System/Tests/test_back_forth_10_times.py | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 System/Tests/test_back_forth_10_times.py (limited to 'System/Tests') diff --git a/System/Tests/test_back_forth_10_times.py b/System/Tests/test_back_forth_10_times.py new file mode 100644 index 0000000..3feaba4 --- /dev/null +++ b/System/Tests/test_back_forth_10_times.py @@ -0,0 +1,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() -- cgit v1.2.3