← Back to ratslair.com
aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorEdvin <[email protected]>2025-05-06 08:32:19 +0200
committerEdvin <[email protected]>2025-05-06 08:32:19 +0200
commit85fd7203f5c0bd54c564d529f326189edfa48830 (patch)
tree12194c71820a8d42231219c4f7d74318c3a354d3 /main.py
parent665301be294bbc1bc378a46d50d0f069bd10b748 (diff)
Changed some turning stuff
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py26
1 files changed, 1 insertions, 25 deletions
diff --git a/main.py b/main.py
index 77fedf1..56905d0 100755
--- a/main.py
+++ b/main.py
@@ -31,22 +31,11 @@ bto = BluetoothProcess.stdout.readline().strip()
print(bto)
newCommand = False
-rightTurnIndexN = 100
-rightTurnIndexF = 50
-rightTurnIndexR = 0
-rightTurn = 0
-leftTurnIndexN = 100
-leftTurnIndexF = 50
-leftTurn = 0
-
-angle = 0.0
dwm = ""
x = ""
y = ""
-curX = 0
-curY = 0
oldX = 0
oldY = 0
backward = False
@@ -89,19 +78,6 @@ if bto.find("Connected") != -1:
# if float(qf) > 80:
print(x + ", " + y)
- # Send commands to Arduino based on bto
- if rightTurn > 0:
- NANO.write(b"Right\n")
- rightTurn = rightTurn - 1
- if rightTurn == 0:
- NANO.write(b"00")
-
- if leftTurn > 0:
- NANO.write(b"Left\n")
- leftTurn = leftTurn - 1
- if leftTurn == 0:
- NANO.write(b"00")
-
if newCommand:
print(f"Command: {bto}")
if bto == "11":
@@ -159,7 +135,7 @@ if bto.find("Connected") != -1:
elif bto == "420":
print("reset")
desDir = 0
- else:
+ elif bto == "0":
# Store current position => cur pos
# curX = float(x) * 1000
# curY = float(y) * 1000