Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
SimpleScheduler Class Reference
#include <SimpleScheduler.h>
Detailed Description
Manages a set of function or class.methods as tasks to be called at a scheduled frquency. Simple round-robin task caller. Note, it's cooperative. That means your task functions must return BEFORE another task can be called.
#include "mbed.h" #include "SimpleScheduler.h" DigitalOut led1(LED1); DigitalOut led2(LED2); DigitalOut led3(LED3); void f1(SimpleTask *task) { led1 = !led1; } void f2(SimpleTask *task) { led2 = !led2; } void f3(SimpleTask *task) { led3 = !led3; } SimpleScheduler *scheduler; int main() { scheduler = new SimpleScheduler; scheduler ->addTask( new SimpleTask(0, f1) ) // As often as possible ->addTask( new SimpleTask(200, f2) ) // Every 200milliseconds ->addTask( new SimpleTask(1.0, f3) ) // Once a second ; scheduler->run(); }
Definition at line 180 of file SimpleScheduler.h.
Generated on Fri Jul 15 2022 08:21:53 by
1.7.2