diff options
| author | Anatoli Arkhipenko <arkhipenko@hotmail.com> | 2015-10-22 23:17:45 -0400 |
|---|---|---|
| committer | Anatoli Arkhipenko <arkhipenko@hotmail.com> | 2015-10-22 23:17:45 -0400 |
| commit | ccd1047d0286027ff98ee7f1dfdfa1f9d5e6e4e3 (patch) | |
| tree | 2481326454d89e1977923475fda443ba3a78922c /examples/Scheduler_example/Scheduler_example.ino | |
| parent | bb20df9c654cbed77bb5007814ae06f20f08ec36 (diff) | |
Support for taask IDs and Control Pointsv1.8.1
* Automatically and manually assigned task IDs
* Manually assigned Control Points within task's callback function
* Updated existing examples
* New example sketches
Diffstat (limited to 'examples/Scheduler_example/Scheduler_example.ino')
| -rw-r--r-- | examples/Scheduler_example/Scheduler_example.ino | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/examples/Scheduler_example/Scheduler_example.ino b/examples/Scheduler_example/Scheduler_example.ino index dece85a..74b60f9 100644 --- a/examples/Scheduler_example/Scheduler_example.ino +++ b/examples/Scheduler_example/Scheduler_example.ino @@ -1,3 +1,16 @@ +/** + * TaskScheduler Test + * + * Initially only tasks 1 and 2 are enabled + * Task1 runs every 2 seconds 10 times and then stops + * Task2 runs every 3 seconds indefinitely + * Task1 enables Task3 at its first run + * Task3 run every 5 seconds + * Task1 disables Task3 on its last iteration and changed Task2 to run every 1/2 seconds + * At the end Task2 is the only task running every 1/2 seconds + */ + + #include <TaskScheduler.h> Task t4(); @@ -5,18 +18,6 @@ Task t1(2000, 10, &t1Callback); Task t2(3000, -1, &t2Callback); Task t3(5000, -1, &t3Callback); -// Test -// Initially only tasks 1 and 2 are enabled -// Task1 runs every 2 seconds 10 times and then stops -// Task2 runs every 3 seconds indefinitely -// Task1 enables Task3 at its first run -// Task3 run every 5 seconds -// loop() runs every 1 second (a default scheduler delay, if no shorter tasks' interval is detected) -// Task1 disables Task3 on its last iteration and changed Task2 to run every 1/2 seconds -// Because Task2 interval is shorter than Scheduler default tick, loop() executes ecery 1/2 seconds now -// At the end Task2 is the only task running every 1/2 seconds - - Scheduler runner; @@ -74,9 +75,5 @@ void setup () { void loop () { - runner.execute(); - - Serial.println("Loop ticks at: "); - Serial.println(millis()); } |
