apuntes_Arduino/PWM_pin9/PWM_pin9.ino

17 lines
239 B
C++
Executable File

#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);
}
}