]> git.piffa.net Git - sketchbook_andrea/blob - basic/led_PWM_simple/led_PWM_simple.ino
45d3ff9e6a5f1e085c2d48ce36102e83f23441c1
[sketchbook_andrea] / basic / led_PWM_simple / led_PWM_simple.ino
1 /*
2     Adafruit Arduino - Lesson 3. RGB LED
3  */
4
5 int redPin = 11;
6 int greenPin = 10;
7 int bluePin = 9;
8 int c = 0;
9
10 //uncomment this line if using a Common Anode LED
11 //#define COMMON_ANODE
12
13 void setup()
14 {
15   pinMode(redPin, OUTPUT);
16
17 }
18
19 void loop()
20 {
21   for ( c = 0; c < 255 ; c++) {
22     analogWrite(redPin, c) ;
23     delay(5 );
24   }
25 }
26
27