Skip to content

Commit bd1ec4d

Browse files
committed
feat: delays on rotate move and reset_pose
1 parent 7126cf0 commit bd1ec4d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

arduino_alvik.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def rotate(self, angle: float):
102102
:param angle:
103103
:return:
104104
"""
105+
sleep_ms(200)
105106
self.packeter.packetC1F(ord('R'), angle)
106107
uart.write(self.packeter.msg[0:self.packeter.msg_size])
107108

@@ -111,6 +112,7 @@ def move(self, distance: float):
111112
:param distance:
112113
:return:
113114
"""
115+
sleep_ms(200)
114116
self.packeter.packetC1F(ord('G'), distance)
115117
uart.write(self.packeter.msg[0:self.packeter.msg_size])
116118

@@ -229,6 +231,7 @@ def reset_pose(self, x: float, y: float, theta: float):
229231
"""
230232
self.packeter.packetC3F(ord('Z'), x, y, theta)
231233
uart.write(self.packeter.msg[0:self.packeter.msg_size])
234+
sleep_ms(1000)
232235

233236
def get_pose(self) -> (float, float, float):
234237
"""

pinout_definitions.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33
# NANO to STM32 PINS
44
D2 = 5 # ESP32 pin5 -> nano D2
55
D3 = 6 # ESP32 pin6 -> nano D3
6+
D4 = 7 # ESP32 pin7 -> nano D4
7+
8+
A4 = 11 # ESP32 pin11 SDA -> nano A4
9+
A5 = 12 # ESP32 pin12 SCL -> nano A5
610
A6 = 13 # ESP32 pin13 -> nano A6/D23
11+
712
BOOT0_STM32 = Pin(D2, Pin.OUT) # nano D2 -> STM32 Boot0
8-
RESET_STM32 = Pin(D3, Pin.OUT) # nano D2 -> STM32 NRST
13+
RESET_STM32 = Pin(D3, Pin.OUT) # nano D3 -> STM32 NRST
14+
NANO_CHK = Pin(D4, Pin.OUT) # nano D3 -> STM32 NRST
915
CHECK_STM32 = Pin(A6, Pin.IN, Pin.PULL_UP) # nano A6/D23 -> STM32 ROBOT_CHK
16+
ESP32_SDA = Pin(A4, Pin.OUT)
17+
ESP32_SCL = Pin(A5, Pin.OUT)

0 commit comments

Comments
 (0)