jm_Scheduler - A Cooperative Scheduler Library for Arduino

I just released the v1.0.9 of the jm_Scheduler library.

This version is compatible with every Arduino, from UNO till the latest ESP32 by Expressif.
I just added 5 new Blink progressiv examples, demonstrating how to convert the well known Arduino Blink example to an optimized jm_Scheduler Blink example, step-by-step.

jm_Scheduler doesn't swap tasks as RTOS do it, but more like JavaScript/Node.js switches from an event to another, never interrupting the current process. By design, jm_Scheduler doesn't require multiple stacks to execute multiple process because all process are executed on the current stack, one after another.

For a good usage of jm_Scheduler, each process must be splitted in short coroutines. Next jm_Scheduler calls them on time. Blink examples demonstrate the main idea of jm_Scheduler, how to avoid delay() usage.

ESP32 notes:

Jm_Scheduler is now compatible with ESP32.
You must know that the implementation of ESP32 in the Arduino environment is a little bit tricky.
For example, the Arduino.h file does not follow the Arduino declaration conventions because it can not be inserted into .h files, it must only be present once and it is declared automatically in the .ino

There is another feature with ESP32 Arduino implementation: The preemptive scheduler RTOS is already installed and the yield() function is dedicated to it. Thus, in the Arduino loop() function, you have to put the static method jm_Scheduler::yield() instead of yield().

One more detail: ESP32 for Arduino does not define LED_BUILTIN. In each jm_Scheduler examples, the led.h included file defines LED_BUILTIN with the value 2 for ESP32 architecture.

Would be useful if you include a link to your library.

marco_c:
Would be useful if you include a link to your library.

jm_Scheduler is available via the Arduino library manager.

The development link is GitHub - jmparatte/jm_Scheduler: Scheduler Library for Arduino