From 786cc4007e4dca597870b4472679c18cd5635458 Mon Sep 17 00:00:00 2001 From: Edvin Date: Fri, 11 Apr 2025 15:45:10 +0200 Subject: Lets the DWM1001 store position in text file --- DWM.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DWM.py b/DWM.py index a7c0a97..86cb07e 100644 --- a/DWM.py +++ b/DWM.py @@ -48,6 +48,10 @@ with serial.Serial('/dev/ttyACM0', 115200, timeout = 1) as s: str = f"{s.readline().decode('utf-8').strip('\n')}" if "apg: x:" in str: - print(str.replace("apg: ", "")) + str = str.replace("apg: ", "") + print(str) + with open("posititon.txt", "w") as f: + f.write(str + '\n') + f.close() print("Shutting down serial communication") -- cgit v1.2.3