i need to turn on an LED propotional to the position of the variable resistor.i have written the following code in the normal way.Please suggest how i can change the brightness of the LED propotional to the position of the variable resistor.Thank you.
The documentation for analogWrite() says: "You do not need to call pinMode() to set the pin as an output before calling analogWrite()." That would not explain your unspecified symptom.
What model of Arduino are you using? It shouldn't matter since all models seem to support analog output (PWM) on Pin 11.