UART P0 and P1
-
Hi People
I'm working on a project using the LoPy for its LoRa communication, but the important thing is that it interacts with the other components through UART (technically only a single microcontroller but that interactions with all other components).
Naturally, I would need like most operations to be non blocking. I know, I can acheive it usinguart.any().
However, as of now, it is connected through Pin 0 and 1, which is also the Pins where there REPL loop connects to.
As such I cannot instantiate the UART for these pins, and I cannot acheive this non blocking operation of the system.
Is there any way to either manually create the UART for these pins to have the UART-object or otherwise useinput()orsys.stdinin a non blocking fashon?Thanks beforehand!
-
@Zinoex You can open UART0 like any other uart, even if it is used by REPL, and use uart.any() for checking, whether a character arrived. REPL is only active when no code is running. Be aware that this channel is not fully transparent, since by default the input stream is still checked for Ctrl-C and Ctrl-F. You can deactivate this test off by calling micropython.kbd_intr(-1).
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login