Task Scheduler cooperative multitasking for Arduino microcontrollers
Version 2.1.0: 2016-02-01

If you find TaskScheduler useful for your Arduino project, please drop me an email: arkhipenko@hotmail.com

A lightweight implementation of cooperative multitasking (task scheduling) supporting:
1. Periodic task execution (with dynamic execution period in milliseconds or microseconds)
2. Number of iterations (n times)
3. Execution of tasks in predefined sequence
4. Dynamic change of task execution parameters (frequency, number of iterations, callback function)
5. Power saving via entering IDLE sleep mode between tasks are scheduled to run
6. Task invocation via Status Request object
7. Task IDs and Control Points for error handling and watchdog timer
8. Local Task Storage pointer (allowing use of same callback code for multiple tasks)
9. Layered task prioritization

Scheduling overhead: between 15 and 18 microseconds per scheduling pass

Find code here: