File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ Multiple PWM
3+
4+ Demonstrates the use of the Scheduler library
5+
6+ Hardware required :
7+ * LEDs connected to pins 10 and 11 for the UNO board (on other board change the pwm pins)
8+
9+ created 28 Dic 2015
10+ by Testato
11+
12+ */
13+
14+
15+ // Include Scheduler since we want to manage multiple tasks.
16+ #include < Scheduler.h>
17+
18+ byte counter1;
19+ byte counter2;
20+ byte led1 = 10 ;
21+ byte led2 = 11 ;
22+
23+
24+ void setup () {
25+
26+ // Setup the two led pins as OUTPUT
27+ pinMode (led1, OUTPUT);
28+ pinMode (led2, OUTPUT);
29+
30+ // Add "loop2 and loop3" to scheduler
31+ // "loop" is always started by default
32+ Scheduler.startLoop (loop2);
33+ Scheduler.startLoop (loop3);
34+ }
35+
36+
37+ // Task no.1 (standard Arduino loop() )
38+ void loop () {
39+ yield ();
40+ }
41+
42+
43+
44+
45+
You can’t perform that action at this time.
0 commit comments