#πŸ”’ Need help for Multitasking in CircuitPython with asyncio

20 messages Β· Page 1 of 1 (latest)

quiet imp
shut hatchBOT
#

@quiet imp

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

novel kettle
#

The audiobusio module would need to support asyncio. I don't see where it does.

quiet imp
#

@novel kettle my bad i gave u a modified version... In the original code, line 140-149, u can see that the sound is blocking the code to to other things

shut hatchBOT
quiet imp
#

and i just want the swing sound playing to be non restrictive because it makes everything lagging when saber is movin

novel kettle
#

Your while statement on 143 is blocking and continuously updating the pixels. Could that be the problem?

quiet imp
novel kettle
#

Set the color once. Then while playing: pass

quiet imp
novel kettle
#

after swing what is wave1?

quiet imp
#

wav 1 is the saber sound when its on (always playing in the background)

novel kettle
#

I guess you could check for hit and button presses during the while playing loop.

#

and then stop the swing and break out.

#

Off to work. Good luck!

shut hatchBOT
shut hatchBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.