int potPin = A0; //analog input pin connect to potentiometer
int potValue = 0; //initial value that will be read from pot
int led = 9; //digital pin 9 connected to led
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(led, OUTPUT); //set pin 9 to output(on/off) the led
}
void loop() {
// put your main code here, to run repeatedly:
potValue = analogRead(potPin); //read potentio value from A0 pin
analogWrite(led, potValue/4); //set potentio value to led brightness
//print/display the current potValue here
delay(10);
}