working ADC input + FFT analysis + py logger
This commit is contained in:
19
serial_debug.py
Normal file
19
serial_debug.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""Quick diagnostic — just print what comes over serial."""
|
||||
import sys
|
||||
import serial
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print(f"Usage: python {sys.argv[0]} <COM_PORT>")
|
||||
sys.exit(1)
|
||||
|
||||
ser = serial.Serial(sys.argv[1], 115200, timeout=2)
|
||||
print(f"Listening on {sys.argv[1]}...")
|
||||
|
||||
while True:
|
||||
raw = ser.readline()
|
||||
if raw:
|
||||
line = raw.decode("utf-8", errors="replace").strip()
|
||||
prefix = line[:20] if len(line) > 20 else line
|
||||
print(f"[{len(line):5d} chars] {prefix}...")
|
||||
else:
|
||||
print("(timeout — no data)")
|
||||
Reference in New Issue
Block a user