Hi,
Is there something like a task scheduler in CircuitPython? I'm looking for something like uasyncio or periodic timers - I need to implement a CAN-based communication protocol, and it's hard to do it without interrupts.
Thanks
Task Scheduler
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- dastels
- Posts: 15820
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Task Scheduler
As far as I know, CircuitPython doesn't have support for real-time programming (or interrupt driven, or concurrent). It skews toward education and hobby use. For more professional/industrial use have a look at MicroPython.
Dave
Dave
- TeddyBonkers
- Posts: 11
- Joined: Tue Sep 14, 2021 3:21 pm
Re: Task Scheduler
Thanks Dave,
I was looking at MicroPython but I think it does not provide support for Feather M4 CAN, so I am probably stuck with the Arduino framework.
I was looking at MicroPython but I think it does not provide support for Feather M4 CAN, so I am probably stuck with the Arduino framework.
- danhalbert
- Posts: 4687
- Joined: Tue Aug 08, 2017 12:37 pm
Re: Task Scheduler
Take a look at https://github.com/WarriorOfWire/CircuitPython_async (formerly tasko), which is a library that uses async/await to provide an event loop. This is not real-time interrupts, as MicroPython provides, but it is tasking.
An even simpler library is here:
https://github.com/deshipu/meanwhile
We have had discussions about these kinds of capabilities here:
https://github.com/adafruit/circuitpython/issues/4542
https://github.com/adafruit/circuitpython/issues/1380 (discussion closed)
An even simpler library is here:
https://github.com/deshipu/meanwhile
We have had discussions about these kinds of capabilities here:
https://github.com/adafruit/circuitpython/issues/4542
https://github.com/adafruit/circuitpython/issues/1380 (discussion closed)
- TeddyBonkers
- Posts: 11
- Joined: Tue Sep 14, 2021 3:21 pm
Re: Task Scheduler
I think the CircuitPython_async will do the job for my case. Thanks!
- danhalbert
- Posts: 4687
- Joined: Tue Aug 08, 2017 12:37 pm
Re: Task Scheduler
Another library to look at is https://github.com/cognitivegears/Circu ... n_Schedule
Please be positive and constructive with your questions and comments.