int led = 9;
int brightness = 0;
int faceAmount = 5;
void setup() {
pinMode(led, OUTPUT);
// put your setup code here, to run once:
}
void loop() {
analogWrite(led, brightness);
brightness = brightness + faceAmount;
if (brightness <= 0 || brightness >= 255) {
faceAmount = -faceAmount;
}
delay(30);
// put your main code here, to run repeatedly:
}