TaskScheduler library

Cooperative multitasking for Arduino, Teensy and esp8266 microcontrollers

Version 2.5 - 2017, 2018 (Latest news here)

A lightweight implementation of cooperative multitasking (task scheduling) supporting:

  • Periodic task execution (with dynamic execution period in milliseconds or microseconds)
  • Number of iterations (n times)
  • Execution of tasks in predefined sequence
  • Dynamic change of task execution parameters (frequency, number of iterations, callback function)
  • Power saving via entering IDLE sleep mode between tasks are scheduled to run
  • Event-driven task invocation via Status Request object
  • Task IDs and Control Points for error handling and watchdog timer
  • Local Task Storage pointer (allowing use of same callback code for multiple tasks)
  • Layered task prioritization
  • Support for std::functions (ESP8266 only)

TaskScheduler has been migrated to Github.com:

Latest documentation:



Authors of Arduino libraries, please read this:



Implementation examples:


Share