Arduino-Scheduler
Portable Collaborative Multi-Tasking Scheduler for Arduino
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
SchedulerDebounceTemplate.ino
Go to the documentation of this file.
1
23
#include <
Scheduler.h
>
24
#include "
Debounce.h
"
25
26
// Check for SparkFun SAMD21 Breakout
27
#if defined(ARDUINO_ARCH_SAMD) && (USB_PID == 0x8D21)
28
#define Serial SerialUSB
29
#endif
30
31
const
int
BUTTON
= 4;
32
unsigned
int
count
= 0;
33
34
void
buttonDown
()
35
{
36
Serial.print(millis());
37
Serial.println(F(
":buttonDown"
));
38
count
+= 1;
39
}
40
41
Debounce<BUTTON, buttonDown>
button
;
42
43
void
setup
()
44
{
45
Serial.begin(57600);
46
while
(!Serial);
47
Serial.println(F(
"SchedulerDebounceTemplate: started"
));
48
Scheduler
.
start
(button.
setup
, button.
loop
);
49
}
50
51
void
loop
()
52
{
53
Serial.print(millis());
54
Serial.print(F(
":loop::count="
));
55
Serial.println(
count
);
56
delay(1000);
57
}
button
Debounce< BUTTON, buttonDown > button
Definition:
SchedulerDebounceTemplate.ino:41
loop
void loop()
Definition:
SchedulerDebounceTemplate.ino:51
count
unsigned int count
Definition:
SchedulerDebounceTemplate.ino:32
Debounce
Definition:
Debounce.h:26
Debounce::loop
static void loop()
Definition:
Debounce.h:32
Debounce::setup
static void setup()
Definition:
Debounce.h:28
BUTTON
const int BUTTON
Definition:
SchedulerDebounceTemplate.ino:31
Scheduler
SchedulerClass Scheduler
Definition:
Scheduler.cpp:53
Debounce.h
SchedulerClass::start
static bool start(func_t taskSetup, func_t taskLoop, size_t stackSize=DEFAULT_STACK_SIZE)
Definition:
Scheduler.cpp:76
Scheduler.h
setup
void setup()
Definition:
SchedulerDebounceTemplate.ino:43
buttonDown
void buttonDown()
Definition:
SchedulerDebounceTemplate.ino:34
examples
SchedulerDebounceTemplate
SchedulerDebounceTemplate.ino
Generated on Thu Aug 31 2017 12:52:29 for Arduino-Scheduler by
1.8.11