Skip to content

Commit 436d97b

Browse files
committed
docs/library/machine.UART: Update and improve uart.any() docs.
1 parent aca898e commit 436d97b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/library/machine.UART.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,16 @@ Methods
6565

6666
.. method:: UART.any()
6767

68-
Return true value if there're characters available for reading. On some
69-
boards, the number of available characters is returned.
68+
Returns an integer counting the number of characters that can be read without
69+
blocking. It will return 0 if there are no characters available and a positive
70+
number if there are characters. The method may return 1 even if there is more
71+
than one character available for reading.
72+
73+
For more sophisticated querying of available characters use select.poll::
74+
75+
poll = select.poll()
76+
poll.register(uart, select.POLLIN)
77+
poll.poll(timeout)
7078

7179
.. method:: UART.read([nbytes])
7280

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy