Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
301 B
1
Indexable
Never
//Initializing LED Pin
int led_pin = 9;
void setup() {
  //Declaring LED pin as output
  pinMode(led_pin, OUTPUT);
}
void loop() {
  //Fading the LED
  for(int i=0; i<255; i++){
    analogWrite(led_pin, i);
    delay(5);
  }
  for(int i=255; i>0; i--){
    analogWrite(led_pin, i);
    delay(5);
  }
}