int sensorPin = A0; // selecting the input pin for the potentiometer
int ledPin = 13; // selecting the pin for the LED
int sensorValue = 0; // this is a variable to store the value coming from the sensor
void setup() {
pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT
}
void loop() {
sensorValue = analogRead(sensorPin); // reading the value from the sensor
digitalWrite(ledPin, HIGH); // turning the ledPin on
delay(sensorValue); // delaying the program for <sensorValue>
digitalWrite(ledPin, LOW); // turning the ledPin off
delay(sensorValue); // delaying the program for <sensorValue>
}