// int redLED=13;
// int brightness=255;
// void setup() {
// // put your setup code here, to run once:
// // Understanding the Arduino Analog Write Command//
// pinMode(redLED , OUTPUT);
// }
// void loop() {
// // put your main code here, to run repeatedly:
// analogWrite(redLED , brightness);
// }
int redLED=13;
int brightness=0;
int fadeamount=5;
void setup(){
pinMode(redLED , OUTPUT);
}
void loop(){
analogWrite(redLED , brightness);
brightness=brightness+fadeamount;
if(brightness<=0 || brightness>=255){
fadeamount=-fadeamount;
}
delay(300);
}