Playground.arduino.cc will be read-only starting December 31st, 2018. For more info pleae look at this Forum Post

TaskScheduler library

Cooperative multitasking for Arduino, Teensy and esp8266 microcontrollers

Version 3.0 - 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 and ESP32 only)
  • Support for overall Task timeouts
  • Static and dynamic callback method binding
  • Support for STM32F1 ARM Cortex-M3 boards

TaskScheduler has been migrated to Github.com:

Latest documentation:



Authors of Arduino libraries, please read this:



Implementation examples: