diff options
| author | Edvin <[email protected]> | 2025-04-25 09:35:37 +0200 |
|---|---|---|
| committer | Edvin <[email protected]> | 2025-04-25 09:35:37 +0200 |
| commit | ca0fe916886eb935cd8936ea47c812e92fcd4f3f (patch) | |
| tree | 13059f520f707b21ee316ac9ed35e4cbcc7d4982 /DWM.py | |
| parent | 49675c5b77d8c8d106f8a6c9e610ab8b3d13361a (diff) | |
Improved DWM data collection
Diffstat (limited to 'DWM.py')
| -rwxr-xr-x | DWM.py | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -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') |
