diff options
| author | Edvin <[email protected]> | 2025-04-30 10:49:29 +0200 |
|---|---|---|
| committer | Edvin <[email protected]> | 2025-04-30 10:49:29 +0200 |
| commit | 115b28f0cd219b98209839123c656771c252f6a9 (patch) | |
| tree | 9f0e27622b0bc25930b3f787e3ac20de8359f508 | |
| parent | 1368991f98f7a6eeeb48d2d9adaf7cd0b19e19f6 (diff) | |
Testinggggg
| -rw-r--r-- | arduino/arduino.ino | 2 | ||||
| -rwxr-xr-x | bt.py | 17 | ||||
| -rwxr-xr-x | main.py | 1 |
3 files changed, 5 insertions, 15 deletions
diff --git a/arduino/arduino.ino b/arduino/arduino.ino index b02fd48..9e38b13 100644 --- a/arduino/arduino.ino +++ b/arduino/arduino.ino @@ -28,7 +28,7 @@ void setup() { pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, LOW); - Serial.begin(9600); + Serial.begin(115200); lcd.init(); lcd.backlight(); @@ -1,4 +1,3 @@ -import RPi.GPIO as GPIO from time import sleep import os @@ -38,9 +37,10 @@ while read != "1000": with open("position.txt", "r") as f: for line in f: line = line.strip("\n") - x, y, z, qf = line.split() - x = x.translate({ord(c): None for c in 'x:'}) - y = y.translate({ord(c): None for c in 'y:'}) + x, y, z, qf = line.split(",") + x = float(x) * 1000 + y = float(y) * 1000 + print(f"x: {x}, y: {y}") recv_sock.send(f"{x}, {y}, ".encode()) # message = message + f"{x}, {y}, " f.close() @@ -68,14 +68,5 @@ while read != "1000": # message = message + f"{distances[360]}\n" # recv_sock.send(message.encode()) - - # Send LIDAR data - # if read == "77": - # # Remove for KTS - # recv_sock.send("EOD\n".encode()) - - # Send DWM data - # if read == "88": - print("Shutting down...") server_sock.close() @@ -124,7 +124,6 @@ if bto.find("Connected") != -1: desDir = 0 else: # Store current position => cur pos - # Calculate angle from old pos, a = math.atan2(y, x) + math.pi curX = float(x) * 1000 curY = float(y) * 1000 |
