#include <SoftPWM.h>
int led = 13; // the PWM pin the LED is attached to
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
void setup(){
SoftPWMBegin();
SoftPWMSet(led, 0);
}
void loop(){
SoftPWMSet(led, brightness);
brightness = brightness + fadeAmount;
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
delay(30);
}