Using asyncio inside a (seperate) class #16805
Unanswered
MrTinkerman
asked this question in
Using MicroPython
Replies: 1 comment 1 reply
-
Only one asyncio loop is allowed and you are creating one in your main code and another in your class. So maybe the following is what you are after, but of course that just a quick slice and dice of your code example so it may not be exactly what you were after :)
and the tx_lib.py file contain the class
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I'm exploring asyncio and got it working in my main code.
However, I would also like to use asyncio in a separate class that can do it's own async stuff but I could use some hints.
My goal:
-- Main async code queues messages to the class
-- Class sends out the messages at a set interval
Why not do it in the main code? Because it's a lora class, 350 lines of code, handling SPI, the queue, message ID's, acks, retries.
And I would like it to be standalone for re-use.
So I have some code to test the basic working, but it doesn't work :(
So my question is, what should I do to get this working?
Thanks!
My main code
My class
Beta Was this translation helpful? Give feedback.
All reactions