← Back to ratslair.com
aboutsummaryrefslogtreecommitdiff
path: root/DWM.py
diff options
context:
space:
mode:
authorEdvin <[email protected]>2025-04-25 09:35:37 +0200
committerEdvin <[email protected]>2025-04-25 09:35:37 +0200
commitca0fe916886eb935cd8936ea47c812e92fcd4f3f (patch)
tree13059f520f707b21ee316ac9ed35e4cbcc7d4982 /DWM.py
parent49675c5b77d8c8d106f8a6c9e610ab8b3d13361a (diff)
Improved DWM data collection
Diffstat (limited to 'DWM.py')
-rwxr-xr-xDWM.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/DWM.py b/DWM.py
index ccee6a7..3861ed4 100755
--- a/DWM.py
+++ b/DWM.py
@@ -34,21 +34,22 @@ with serial.Serial('/dev/ttyACM0', 115200, timeout = 1) as s:
s.write(b"aurs ")
sleep(0.1)
- s.write(b"10 20")
+ s.write(b"10 10")
sleep(0.1)
s.write(b'\r')
print("Set update rate to 1 1")
- while True:
- sleep(0.1)
- s.write(b"apg")
- sleep(0.1)
- s.write(b"\r")
+ sleep(0.1)
+ s.write(b"lep")
+ sleep(0.1)
+ s.write(b"\r")
+ sleep(0.1)
+ while True:
str = s.readline().decode('utf-8').strip('\n')
- if "apg: x:" in str:
- str = str.replace("apg: ", "")
+ if "POS," in str:
+ str = str.replace("POS,", "")
print(str)
with open("position.txt", "w") as f:
f.write(str + '\n')