apuntes_Arduino/LEDs/Baliza_2Led_PWM/Baliza_2Led_PWM.ino

29 lines
602 B
C++
Executable File

// the setup function runs once when you press reset or power the board
void setup() {
pinMode(10, OUTPUT);// initialize digital pin LED_BUILTIN as an output.
pinMode(11, OUTPUT);
pinMode(9, OUTPUT);
}
void loop() { // the loop function runs over and over again forever
int i;
int j;
int k;
for (i = 0; i <= 255; i++) {
j = 255 - i;
analogWrite(10, i);
analogWrite(11, j);
analogWrite(9, j);
//delay(1);
}
for (j = 255; j >= 0; j--) {
i = 255 - j;
analogWrite(10, i);
analogWrite(11, j);
analogWrite(9, j);
//delay(1);
}
}