Probably because the readline() is timing out. "Read a line, ending in a newline character. It may return sooner if a timeout is reached."
Try this readline.pyand writeline.py
Try this readline.py
Code:
from machine import UART, Pinimport timeuart0 = UART(0, baudrate=115200, tx=Pin(0), rx=Pin(1), timeout=2000)while True: x=uart0.readline() if x is not None: print(x)
Code:
from machine import UART, Pinimport timen=0uart0 = UART(0, baudrate=115200, tx=Pin(0), rx=Pin(1))while True: uart0.write("Hello World "+str(n)+"\n") n=n+1 time.sleep(1.0)
Statistics: Posted by neilgl — Fri Aug 16, 2024 2:30 pm