const int potPin=2;//Select the input pin for potential meter
const int ledPin=5;//selact the pin for led
int val=0;// variable to stoare the value coming from the sensor
void setup() {
// put your setup code here, to run once:
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
val=analogRead(potPin);//read the voltage on the pot
digitalWrite(ledPin, HIGH);//turn the ledpin on
delay(val);// blink rate set by pot value
digitalWrite(ledPin, LOW);
delay(val);
Serial.println(val);
}