int a = 0; void setup() { pinMode(9, OUTPUT); } void loop() { for (a=0; a<255; a++) { analogWrite(9, a); delay(10); } for (a=255; a>0; a--) { analogWrite(9, a); delay(10); } }