Arduino-Scheduler
Portable Collaborative Multi-Tasking Scheduler for Arduino
Clock.h
Go to the documentation of this file.
1 
22 #ifndef CLOCK_H
23 #define CLOCK_H
24 
25 namespace Clock {
26 
27  volatile unsigned long seconds = 0;
28 
29  void setup()
30  {
31  }
32 
33  void loop()
34  {
35  unsigned long start = millis();
36  await(millis() - start >= 1000);
37  seconds += 1;
38  }
39 };
40 
41 #endif
void loop()
Definition: Clock.h:33
void setup()
Definition: Clock.h:29
#define await(cond)
Definition: Scheduler.h:162
volatile unsigned long seconds
Definition: Clock.h:27
Definition: Clock.h:25