diff options
| author | Edvin <[email protected]> | 2025-05-06 16:39:16 +0200 |
|---|---|---|
| committer | Edvin <[email protected]> | 2025-05-06 16:39:16 +0200 |
| commit | 2dce42a6f87dbebc37e1eb756b60af51eca409c6 (patch) | |
| tree | a5f71be9e30a018adba5e418b65571e96821a27f /bt.py | |
| parent | 8ce8c28cc67f5c679c87301d513bec0058328caf (diff) | |
Added angle holding and stop and measure command
Diffstat (limited to 'bt.py')
| -rwxr-xr-x | bt.py | 30 |
1 files changed, 21 insertions, 9 deletions
@@ -39,15 +39,27 @@ while read != "1000": # message = message + read # Send DWM data - with open("position.txt", "r") as f: - for line in f: - line = line.strip("\n") - x, y = line.split(",") - x = int(x) - y = int(y) - recv_sock.send(f"{x}, {y}, ".encode()) - # message = message + f"{x}, {y}, " - f.close() + if read == "10": + sleep(1) + with open("position_mean.txt", "r") as f: + for line in f: + line = line.strip("\n") + x, y = line.split(",") + x = int(x) + y = int(y) + recv_sock.send(f"{x}, {y}, ".encode()) + # message = message + f"{x}, {y}, " + f.close() + else: + with open("position.txt", "r") as f: + for line in f: + line = line.strip("\n") + x, y = line.split(",") + x = int(x) + y = int(y) + recv_sock.send(f"{x}, {y}, ".encode()) + # message = message + f"{x}, {y}, " + f.close() # Send angle data with open("angle.txt", "r") as f: |
