int beep=9;
int potpin=0;
void setup() {
Serial.begin(9600);
pinMode(beep,OUTPUT);
}
void voice(int del) {
delay(del);
digitalWrite(beep,HIGH);
delay(del);
digitalWrite(beep,LOW);
}
void loop()
{
int val=analogRead(potpin);
Serial.println(val);
if(val<450)
{
voice(val);
}
}