|
|
2 ヶ月 前 | |
|---|---|---|
| .github | 3 ヶ月 前 | |
| examples | 3 ヶ月 前 | |
| extras | 3 ヶ月 前 | |
| src | 2 ヶ月 前 | |
| tests | 3 ヶ月 前 | |
| LICENSE.txt | 1 年間 前 | |
| README.md | 2 ヶ月 前 | |
| keywords.txt | 3 ヶ月 前 | |
| library.json | 2 ヶ月 前 | |
| library.properties | 2 ヶ月 前 |

A lightweight implementation of cooperative multitasking (task scheduling). An easier alternative to preemptive programming and frameworks like FreeRTOS.
Why cooperative?
You mostly do not need to worry about pitfalls of concurrent processing (races, deadlocks, livelocks, resource sharing, etc.). The fact of cooperative processing takes care of such issues by design.
“Everybody who learns concurrency and thinks they understand it, ends up finding mysterious races they thought weren’t possible, and discovers that they didn’t actually understand it yet after all.” Herb Sutter, chair of the ISO C++ standards committee, Microsoft.
Main features:
milliseconds (default) or microseconds (if explicitly enabled) – frequency of executionstd::functions (tested on ESPx and STM32 only)Scheduling overhead: between 15 and 18 microseconds per scheduling pass (Arduino UNO rev 3 @ 16MHz clock, single scheduler w/o prioritization)
TaskScheduler was tested on the following platforms:
_TASK_NON_ARDUINO and _task_millis() implementation)_TASK_NON_ARDUINO and _task_millis() implementation - that's how Unit tests are done)Don't just take my word for it - try it for yourself on Wokwi

Changelog is located here.
Please refer to TaskScheduler documentation on GitHub Pages or in the Wiki page.
As of version 4.0.0 TaskScheduler has a comprehensive set of compilation and unit tests. Please submit a PR with your changes and make sure that your code passes all the tests.
There is no such thing as enough testing. If you come up with another test scenario - please contribute!
"I've used https://github.com/arkhipenko/TaskScheduler with great success. Running LED patterns, monitoring button presses, reading data from an accelerometer, auto advancing to the next pattern, reading data from Serial. All at the same time." - here
"There are libraries that do this automatically on Arduino too, allowing you to schedule [cooperative] multitasking and sleep the uC between tasks. E.g. https://github.com/arkhipenko/TaskScheduler is really good, I've used it before. You basically queue up a list of task callbacks and a schedule in your setup() and then do a call to tasks.execute() in loop(), which pops off the next task that is due in a queue or sleeps otherwise. It's simple, but much more straightforward than manually using if millis() - last > delta1... else sleep() and not as rigid as using the timer ISRs (which really serve a different purpose)." - here
"I took the controller with me on a business trip and spend the night getting the basic code framework out. It is going to run on top of Arkhipenko’s TaskScheduler. (https://github.com/arkhipenko/TaskScheduler) This should help me isolate any issues between the different control systems while managing the different task’s timing requirements." - here
"it's really cool and useful, for whenver you want your MCU to do more than 1 task" - here
"I encourage you to use it in the Arduino environment, it allows you to save a lot of time (and code lines) wherever you need to schedule, i.e. run many tasks that should to perform at different frequencies and when we want to have the greatest control over the performance of these tasks and we want good diagnostic of errors." - here
"arkhipenko/TaskScheduler is still my choice for now, especially when I get my pull request in, so we can have that idle 1 ms sleep feature for free." - here
"The difference with milis is basically that you don’t have to be using logics to manage the executions, but the module itself does it. This will allow us to make code more readable and easier to maintain. In addition, we must take into account the extra functions it provides, such as saving energy when not in use, or changing settings dynamically." - here
3 Devo - Quality 3D printing filament, now made accessible and affordable (http://3devo.eu/license-information/)
Houston midi clock project - TaskScheduler with microseconds resolution
by chaffneue:
My first arduino project. It's a multi-master midi controller with a shared clock and auto count in behaviour.
Hackabot Nano by Funnyvale - Compact Plug and Play Arduino compatible robotic kit https://www.kickstarter.com/projects/hackarobot/hackabot-nano-compact-plug-and-play-arduino-robot
Discrete Time Systems Wiki - https://sistemas-en-tiempo-discreto.fandom.com/es/wiki/Tiempo_Real
APIS - Automated Plant Irrigation System (Arduino Uno) (http://www.instructables.com/id/APIS-Automated-Plant-Irrigation-System/)
Party Lights LEDs music visualization (Leaf Maple Mini) (https://www.instructables.com/id/Portable-Party-Lights/)
Arduino Nano based Hexbug Scarab Robotic Spider (Arduino Nano) (http://www.instructables.com/id/Arduino-Nano-based-Hexbug-Scarab-Robotic-Spider/)
Wave your hand to control OWI Robotic Arm... no strings attached (Arduino Uno and Nano) (http://www.instructables.com/id/Wave-your-hand-to-control-OWI-Robotic-Arm-no-strin/)
Interactive Halloween Pumpkin (Arduino Uno) (http://www.instructables.com/id/Interactive-Halloween-Pumpkin/)