int buzpin=13;
int potpin=A0;
float volume;
int wt1=1;
void setup() {
Serial.begin(9600);
pinMode(buzpin,OUTPUT);
pinMode(potpin, INPUT);
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
int potval= analogRead(potpin);
volume=(9940.0/1023.0)*potval + 60;
Serial.println(potval);
int wt2=volume;
digitalWrite(buzpin, HIGH);
delayMicroseconds(wt2);
digitalWrite(buzpin, LOW);
delayMicroseconds(wt2);
}