apuntes_Arduino/PWM_pin9/PWM_pin9.ino

17 lines
239 B
Arduino
Raw Normal View History

2021-01-05 00:15:16 -03:00
#define LED 9
void setup() {
pinMode(LED, OUTPUT);
}
void loop() {
for (byte i=20; i<255; i++) {
analogWrite(LED, i);
delay(5);
}
for (byte i=255; i>20; i--) {
analogWrite(LED, i);
delay(5);
}
}