// Init the Pins used for PWM const int redPin = 9; const int greenPin = 10; const int bluePin = 11; // Init the Pins used for 10K pots const int redPotPin = 0; const int greenPotPin = 1; const int bluePotPin = 2; // Init our Vars int currentColorValueRed; int currentColorValueGreen; int currentColorValueBlue; void setup() { pinMode(redPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(bluePin, OUTPUT); } int redVal; int blueVal; int greenVal; void loop() { currentColorValueRed = 255; currentColorValueBlue = 0; currentColorValueGreen = 0; for( int i = 0 ; i < 255 ; i += 1 ){ currentColorValueGreen += 1; currentColorValueRed -= 1; analogWrite( greenPin, 255 - currentColorValueGreen ); analogWrite( redPin, 255 - currentColorValueRed ); delay( 30 ); } currentColorValueRed = 0; currentColorValueBlue = 0; currentColorValueGreen = 30; for( int i = 0 ; i < 255 ; i += 1 ){ currentColorValueBlue += 1; analogWrite( bluePin,currentColorValueBlue ); analogWrite( greenPin,currentColorValueGreen); delay( 30); } }