Closed martinwork closed 3 years ago
Thanks for the report, I could confirm the issue with uart.any()
always returning True, as well as uart.read(1)
never timing out.
Both these issues should be fixed by 967c0765c88f3b1fb3e765123bf0ae788bac1bb3
The garbage characters is a separate (CODAL?) issue.
@martinwork can you please test with the fix and close this issue to confirm it is fixed?
Testing with 967c076 and Mu, uart.any and the sample above work as expected.
On V2 the program below immediately shows A on the display, then E, indicating
uart.any()
has returned true and the program is waiting inside uart.read(). Typing a single character in tera term shows F, G and returns straight to E, waiting in uart.read() again.On V1 it just flashes the pixel, indicating that
uart.any()
is returning false, until a character is typed in tera term.In the Python editor, https://python.microbit.org/v/beta, the word "any" is displayed green. Is that expected?
On V2 at least, uart.read() seems never to timeout.
In a C++ CODAL program, uBit.serial.isReadable() seems to work, so long as setRxBufferSize() is called: https://github.com/lancaster-university/codal-microbit-v2/issues/47
This program also demonstrates the V2 power up garbage problem. After connecting with tera term, power cycle V2 a few times, until it shows E,F,G on startup, then type SPACE in tera term to see odd characters echoed back.