Skip to content

Commit 0071c44

Browse files
committed
Create MultiplePWM.ino
new Example
1 parent 2294a27 commit 0071c44

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

examples/MultiplePWM/MultiplePWM.ino

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+

0 commit comments

Comments
 (0)