// LED Brightness Control for Arduino Uno
// Connect a potentiometer to analog pin A0
const int potPin = A0;
const int ledPin = 9;
void setup() {
pinMode(potPin, INPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
// Read potentiometer value (0-1023)
int potValue = analogRead(potPin);
// Map potentiometer value to LED brightness (0-255)
int brightness = map(potValue, 0, 1023, 0, 255);
// Set LED brightness
analogWrite(ledPin, brightness);
}