LED Brightness Control Using Potentiometer

Solving Approach:

How do you plan to solve it?

 

 

Code

/*Paste your code here*/
int potPin = A0;
int ledPin = 5;   // PWM pin

void setup() {}

void loop() {
  int value = analogRead(potPin);         // 0–1023
  int pwm = value/4;  // convert to PWM range
  analogWrite(ledPin, pwm);



 

Output

Video

Add video of output (know more)

 

 

 

 

 

Photo of Output

Add a photo of your hardware showing the output.

 

 

 

 

Upvote
Downvote

Submit Your Solution

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