const int potPin =A0; //potentiometer is connected to pin A0
const int ledPin = 13;// LED is connected to 13
int potValue =0;

void setup() {
pinMode(ledPin, OUTPUT); //Sets the LED pin as an output 
}


void loop() {

potValue= analogRead(potPin);
//Sets the ARDUIONO to read the value set on the specified pin A0(the  potentiometer)
digitalWrite(ledPin, HIGH);//Switches on the LED
delay(potValue);//this is a delay
digitalWrite(ledPin, LOW );//switches off the LED
delay(potValue);//this is a delay 

}