int ledR = 6; // the PWM pin the LED is attached to
int ledG = 5; // the PWM pin the LED is attached to
int ledB = 3; // the PWM pin the LED is attached to
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
void setup() {
// put your setup code here, to run once:
pinMode(OUTPUT,ledR);
pinMode(OUTPUT,ledG);
pinMode(OUTPUT,ledB);
analogWrite(ledR,255);
analogWrite(ledB,255);
}
void loop() {
// put your main code here, to run repeatedly:
analogWrite(ledG,brightness);
brightness = brightness + fadeAmount;
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
delay(30);
}