Skip to content

Commit a30ba79

Browse files
committed
add sleep and remove byte read
1 parent 1942a8a commit a30ba79

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

weight_predict/weight_predict.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import json
2-
2+
from time import sleep
33
import serial
44
from typing import List, Tuple
55
from data_classes import Item
@@ -122,12 +122,15 @@ def main():
122122
baudrate=115200,
123123
bytesize=serial.EIGHTBITS,
124124
parity=serial.PARITY_NONE,
125-
stopbits=serial.STOPBITS_ONE
125+
stopbits=serial.STOPBITS_ONE,
126+
timeout=1
126127
)
127128

128129

129130
while True:
130131

132+
sleep(0.1)
133+
131134
line = esp_uart_port.readline().decode('utf-8', errors='ignore').strip()
132135

133136
if not line:

0 commit comments

Comments
 (0)