15 lines
300 B
Python
15 lines
300 B
Python
import serial
|
|
import time
|
|
|
|
try:
|
|
puerto = serial.Serial('/dev/ttyAMA0', 921600, timeout=0.5)
|
|
print("Puerto abierto.")
|
|
puerto.reset_input_buffer()
|
|
|
|
for _ in range(10):
|
|
raw = puerto.readline()
|
|
print("Raw:", raw)
|
|
|
|
except Exception as e:
|
|
print("Error:", e)
|