1// Dim an LED using a PWM pin
2int PWMpin = 10; // LED in series with 470 ohm resistor on pin 10
3
4void setup() {
5 // no setup needed
6}
7
8void loop() {
9 for (int i = 0; i <= 255; i++) {
10 analogWrite(PWMpin, i);
11 delay(10);
12 }
13}