← Back to ratslair.com
aboutsummaryrefslogtreecommitdiff
path: root/bt.py
diff options
context:
space:
mode:
authorEdvin <[email protected]>2025-05-06 16:39:16 +0200
committerEdvin <[email protected]>2025-05-06 16:39:16 +0200
commit2dce42a6f87dbebc37e1eb756b60af51eca409c6 (patch)
treea5f71be9e30a018adba5e418b65571e96821a27f /bt.py
parent8ce8c28cc67f5c679c87301d513bec0058328caf (diff)
Added angle holding and stop and measure command
Diffstat (limited to 'bt.py')
-rwxr-xr-xbt.py30
1 files changed, 21 insertions, 9 deletions
diff --git a/bt.py b/bt.py
index d522ee5..98fc45e 100755
--- a/bt.py
+++ b/bt.py
@@ -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: