arkhipenko / TaskScheduler

Cooperative multitasking for Arduino, ESPx, STM32, nRF and other microcontrollers
http://playground.arduino.cc/Code/TaskScheduler
BSD 3-Clause "New" or "Revised" License
1.26k stars 230 forks source link

Stable State for an task #44

Closed Jomelo closed 6 years ago

Jomelo commented 6 years ago

Hello, it is possible to set a task in a stable state when the status is changed to disable ?

For example: a pump control task

first iteration: // init something

loop: // ....

stable stop/disable state: // pump stop

arkhipenko commented 6 years ago

Yes, this is what OnEnable and OnDisable methods are for. Please refer to wiki-page

arkhipenko commented 6 years ago

Also, an example of use: APIS code for watering