#define POT_PIN A0
#define LED_PIN 9
void setup() {
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600); // Start serial communication
}
void loop() {
int potValue = analogRead(POT_PIN);
analogWrite(LED_PIN, map(potValue, 0, 1023, 0, 255));
Serial.println(potValue); // Print raw input value
delay(200); // Slight delay for readability
}