fix(mic): исправлен таймер на TIM3
This commit is contained in:
19
client/src/test_usb.py
Normal file
19
client/src/test_usb.py
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python3
|
||||
import serial
|
||||
import time
|
||||
|
||||
port = serial.Serial("/dev/ttyACM0", 115200, timeout=1)
|
||||
print(f"Connected to {port.name}")
|
||||
|
||||
port.write(b"test\n")
|
||||
time.sleep(0.1)
|
||||
|
||||
# Читаем 5 секунд
|
||||
start = time.time()
|
||||
while time.time() - start < 5:
|
||||
if port.in_waiting:
|
||||
data = port.read(port.in_waiting)
|
||||
print(f"RX: {data.decode('utf-8', errors='replace')}", end="")
|
||||
time.sleep(0.1)
|
||||
|
||||
port.close()
|
||||
Reference in New Issue
Block a user