Arduino-Scheduler
Portable Collaborative Multi-Tasking Scheduler for Arduino
BlinkTask.h
Go to the documentation of this file.
1 
22 #ifndef BLINK_TASK_H
23 #define BLINK_TASK_H
24 
25 #include <Scheduler.h>
26 #include "Trace.h"
27 
28 namespace BlinkTask {
29 
30  const unsigned int PERIOD = 1000;
31  const int LED = 13;
32 
33  void setup()
34  {
35  TRACE("stack=");
36  Serial.println(Scheduler.stack());
37 
38  TRACELN("led output");
39  pinMode(LED, OUTPUT);
40  }
41 
42  void loop()
43  {
44  TRACE("stack=");
45  Serial.println(Scheduler.stack());
46 
47  TRACELN("led off");
48  digitalWrite(LED, LOW);
49  delay(PERIOD);
50 
51  TRACELN("led on");
52  digitalWrite(LED, HIGH);
53  delay(PERIOD);
54  }
55 };
56 
57 #endif
const int LED
Definition: BlinkTask.h:31
const unsigned int PERIOD
Definition: BlinkTask.h:30
void setup()
Definition: BlinkTask.h:33
static size_t stack()
Definition: Scheduler.cpp:127
SchedulerClass Scheduler
Definition: Scheduler.cpp:53
void loop()
Definition: BlinkTask.h:42
#define TRACE(msg)
Definition: Trace.h:25
#define TRACELN(msg)
Definition: Trace.h:34