diff options
| -rwxr-xr-x | DWM.py | 3 | ||||
| -rwxr-xr-x | main.py | 5 |
2 files changed, 6 insertions, 2 deletions
@@ -77,6 +77,9 @@ with serial.Serial('/dev/ttyACM0', 115200, timeout = 1) as s: sleep(0.1) s.write(b"\r") sleep(0.1) + + for i in range(10): + s.readline() while True: dstr = s.readline().decode('utf-8').strip('\n') @@ -81,6 +81,8 @@ if bto.find("Connected") != -1: #print("Quality factor: " + qf) # if float(qf) > 80: print(f"x: {x}, y: {y}") + print(f"Current direction: {curDir}") + print(f"Desired direction: {desDir}") if newCommand: print(f"Command: {bto}") @@ -151,8 +153,7 @@ if bto.find("Connected") != -1: # curDir = (math.atan2(curY - oldY, curX - oldX) + math.pi) * (180/math.pi) # if backward == True: # a = a - 180 - print(f"Current direction: {curDir}") - print(f"Desired direction: {desDir}") + NANO.write(b"Stop\n") curDir = math.atan2(y - oldY, x - oldX) |
