summaryrefslogtreecommitdiff
path: root/debug/motordriver/PID_autotune/man_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'debug/motordriver/PID_autotune/man_test.py')
-rw-r--r--debug/motordriver/PID_autotune/man_test.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/debug/motordriver/PID_autotune/man_test.py b/debug/motordriver/PID_autotune/man_test.py
new file mode 100644
index 0000000..52c84e3
--- /dev/null
+++ b/debug/motordriver/PID_autotune/man_test.py
@@ -0,0 +1,16 @@
+import serial
+import time
+
+arduino = serial.Serial(port='/dev/ttyACM0', baudrate=115200, timeout=.1)
+
+def write_read(x):
+ arduino.write(bytes(x, 'utf-8'))
+ time.sleep(0.05)
+ data = arduino.readline()
+ return data
+
+while True:
+ num = input("Enter a number: ") # Taking input from user
+ value = write_read(num)
+ print(value) # printing the value
+