All submissions

LED Brightness Control Using Potentiometer

Solving Approach:

How do you plan to solve it?

 

 

Code

const int potPin = A0;      
const int ledPin = 9;       

void setup() 
{
  pinMode(ledPin, OUTPUT);
}

void loop() 
{
  int potValue = analogRead(potPin);         
  int brightness = map(potValue, 0, 1023, 0, 255); 
  analogWrite(ledPin, brightness);           
}




 

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!