summaryrefslogtreecommitdiff
path: root/debug/motordriver/PID_autotune/man_test.py
diff options
context:
space:
mode:
authorAbel Tim <abel@main.home>2024-07-15 14:53:41 +0200
committerAbel Tim <abel@main.home>2024-07-15 14:53:41 +0200
commit6fcefaf1c7087675d403bc3451ca1997ecaa83d6 (patch)
treee43f6e74fac54aa3c90a514508fe2415430990c3 /debug/motordriver/PID_autotune/man_test.py
parent3ce2797f62a124a54644968141feab710b816837 (diff)
downloadrobotica-6fcefaf1c7087675d403bc3451ca1997ecaa83d6.tar.gz
robotica-6fcefaf1c7087675d403bc3451ca1997ecaa83d6.zip
poster
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
+