All submissions

LED Brightness Control Using PWM

Solving Approach:

How do you plan to solve it?

 

 

Code

/*Paste your code here*/

#define PWM_PIN 3


void setup() 
{
  // put your setup code here, to run once:
  pinMode(PWM_PIN,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:

  for(int i=0;i<256;i++)
  {
    analogWrite(PWM_PIN,i);

    delay(4);
  }
  
  for(int i=255;i>=0;i--)
  {
    analogWrite(PWM_PIN,i);

    delay(4);
    
  }

}



 

Output

Video

Add video of output (know more)

 

 

 

 

Photo of Output

Add a photo of your hardware showing the output.

 

 

 


 

Submit Your Solution

Note: Once submitted, your solution goes public, helping others learn from your approach!