Arduino-Scheduler
Portable Collaborative Multi-Tasking Scheduler for Arduino
SchedulerBlinkTemplateFunctions.ino
Go to the documentation of this file.
1 
23 #include <Scheduler.h>
24 
25 template<int pin> void setupBlink()
26 {
27  pinMode(pin, OUTPUT);
28 }
29 
30 template<int pin, unsigned int ms> void loopBlink()
31 {
32  digitalWrite(pin, HIGH);
33  delay(ms);
34  digitalWrite(pin, LOW);
35  delay(ms);
36 }
37 
38 void setup()
39 {
40  setupBlink<13>();
41  Scheduler.start(setupBlink<10>, loopBlink<10,250>);
42  Scheduler.start(setupBlink<11>, loopBlink<11,500>);
43  Scheduler.start(setupBlink<12>, loopBlink<12,750>);
44 }
45 
46 void loop()
47 {
48  loopBlink<13,1000>();
49 }
SchedulerClass Scheduler
Definition: Scheduler.cpp:53
static bool start(func_t taskSetup, func_t taskLoop, size_t stackSize=DEFAULT_STACK_SIZE)
Definition: Scheduler.cpp:76