void setup() { pinMode(1, OUTPUT); } void loop() { for(int i=0; i<=255; i+=5) { analogWrite(1,i); delay(30); digitalWrite(0,0); } for(int i=255; i>=0; i-=5) { analogWrite(1,i); delay(30); digitalWrite(0,0); } }