Arduino-Scheduler
Portable Collaborative Multi-Tasking Scheduler for Arduino
SchedulerBlink.ino
Go to the documentation of this file.
1 
24 #include <Scheduler.h>
25 
26 const int led = 13;
27 
28 void setup()
29 {
30  pinMode(led, OUTPUT);
31 
35 }
36 
37 void loop()
38 {
39  blink(led, 1000);
40 }
41 
42 const int led1 = 10;
43 
44 void setup1()
45 {
46  pinMode(led1, OUTPUT);
47 }
48 
49 void loop1()
50 {
51  blink(led1, 250);
52 }
53 
54 const int led2 = 11;
55 
56 void setup2()
57 {
58  pinMode(led2, OUTPUT);
59 }
60 
61 void loop2()
62 {
63  blink(led2, 500);
64 }
65 
66 const int led3 = 12;
67 
68 void setup3()
69 {
70  pinMode(led3, OUTPUT);
71 }
72 
73 void loop3()
74 {
75  blink(led3, 750);
76 }
77 
78 void blink(int pin, unsigned int ms)
79 {
80  digitalWrite(pin, HIGH);
81  delay(ms);
82  digitalWrite(pin, LOW);
83  delay(ms);
84 }
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