Closed rupin closed 5 years ago
To verify if a task can be executed again after the limited number of iterations it has run for, I created this sketch
#include <TaskScheduler.h> void blinkTask(); void initTaskC(); void repeaterTask(); Task blinking(100, TASK_ONCE , &blinkTask); Task initialisation(1, 1, &initTaskC); Task repet(1000, TASK_FOREVER, &repeaterTask); Scheduler runner; boolean state = false; void initTaskC() { pinMode(PC13, OUTPUT); } void blinkTask() { state = !state; digitalWrite(PC13, state); } void repeaterTask() { blinking.setIterations(1); blinking.restart(); } void setup() { // put your setup code here, to run once: runner.init(); runner.addTask(initialisation); runner.addTask(blinking); initialisation.enable(); blinking.enable(); repet.enable(); } void loop() { // put your main code here, to run repeatedly: runner.execute(); }
The blinking should restart and happen again, but I do not see the task exeucting/LED blinking again.
Please advise what changes should happen in the Repet task callback function repeaterTask()
My error, had not put the repet task in the runner
To verify if a task can be executed again after the limited number of iterations it has run for, I created this sketch
The blinking should restart and happen again, but I do not see the task exeucting/LED blinking again.
Please advise what changes should happen in the Repet task callback function repeaterTask()