apuntes_Arduino/leds/leds_pwm/leds_pwm.ino

26 lines
478 B
Arduino
Raw Normal View History

2021-01-05 00:15:16 -03:00
void setup() {
2022-04-04 17:41:38 -04:00
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(9, OUTPUT);
2021-01-05 00:15:16 -03:00
}
2022-04-04 17:41:38 -04:00
void loop() {
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);
}
2021-01-05 00:15:16 -03:00
for (j = 255; j >= 0; j--) {
2022-04-04 17:41:38 -04:00
i = 255 - j;
analogWrite(10, i);
analogWrite(11, j);
analogWrite(9, j);
//delay(1);
}
2021-01-05 00:15:16 -03:00
}