/**
 * RGB LED 
 * by BARRAGAN <http://barraganstudio.com>
 * 
 * Demonstrates the use of PWM pins (analog output) to change 
 * the color of an RGB LED.
 */

int RED = 0;    // RED pin of the LED to PWM pin 0 
int GREEN = 1;  // GREEN pin of the LED to PWM pin 1
int BLUE = 2;   // BLUE pin of the LED to PWM pin 2

void setup()
{
  // nothing for setup 
}

void loop()
{
  for(int r = 0; r < 1024; r+=5) {
    for(int g = 0; g < 1024; g+=5) {
      for(int b = 0; b < 1024; b+=5) {
        analogWrite(RED, r);
        analogWrite(GREEN, g);
        analogWrite(BLUE, b);
        delay(30);
      }
    }
  }
}
