aboutsummaryrefslogtreecommitdiffstats
path: root/System
diff options
context:
space:
mode:
authorlake0112 <lake0112@umn.edu>2022-02-24 16:09:51 -0600
committerlake0112 <lake0112@umn.edu>2022-02-24 16:09:51 -0600
commitf9223d201adda30d67fbf2af6b7c39b0be5a39c7 (patch)
tree64c08c8650e51af89eb5f432bb25a0d2cf9411a0 /System
parentRefactor speed to torque (diff)
downloadee4511w-f9223d201adda30d67fbf2af6b7c39b0be5a39c7.tar
ee4511w-f9223d201adda30d67fbf2af6b7c39b0be5a39c7.tar.gz
ee4511w-f9223d201adda30d67fbf2af6b7c39b0be5a39c7.tar.bz2
ee4511w-f9223d201adda30d67fbf2af6b7c39b0be5a39c7.tar.lz
ee4511w-f9223d201adda30d67fbf2af6b7c39b0be5a39c7.tar.xz
ee4511w-f9223d201adda30d67fbf2af6b7c39b0be5a39c7.tar.zst
ee4511w-f9223d201adda30d67fbf2af6b7c39b0be5a39c7.zip
add a test
Diffstat (limited to 'System')
-rw-r--r--System/Tests/test_back_forth_10_times.py39
1 files changed, 39 insertions, 0 deletions
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()