mirror of
https://github.com/PotentiaRobotics/engine-software.git
synced 2025-04-19 03:20:18 -04:00
19 lines
369 B
Python
19 lines
369 B
Python
#!/usr/bin/env python
|
|
|
|
import serial #
|
|
import time
|
|
|
|
ser = serial.Serial('/dev/ttyACM0', 9600, timeout=2)
|
|
|
|
# Get rid of garbage/incomplete data
|
|
ser.flush()
|
|
|
|
# Infinite loop
|
|
i = 0
|
|
while (1):
|
|
i+=1
|
|
send_string = ("Data\n")
|
|
ser.write(send_string.encode('utf-8'))
|
|
time.sleep(0.01)
|
|
receive_string = ser.readline().decode('utf-8').rstrip()
|
|
print(receive_string) |