Blocking UART read or readline
without timeout
#15380
Answered
by
GitHubsSilverBullet
alvv-z
asked this question in
RP2040 / Pico
-
Is there a way to disable the timeout of these two methods? I am planning to have the pico only do something (including mirroring to another UART) as a reaction to serial input, so a kind of half duplex communication, if you can call it that. |
Beta Was this translation helpful? Give feedback.
Answered by
GitHubsSilverBullet
Jun 29, 2024
Replies: 2 comments 1 reply
-
uart = machine.UART(0,9600,timeout=int(2**31-1))
>>> int(2**31-1) / 1000 / 86400
24.85514 days If that's not enough, use a while True: loop and exit when read returns anything else than None. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
alvv-z
-
Use asyncio.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If that's not enough, use a while True: loop and exit when read returns anything else than None.