int toneVal;
int potVal;
int buzzPin=13;
int potPin = A1;
//int buzzDelay2=10000000;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);;
pinMode(buzzPin, OUTPUT);
pinMode(potPin, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
potVal = analogRead(potPin);
toneVal = (9940.0/1023.0)*(potVal) + 60;
digitalWrite(buzzPin, HIGH);
delayMicroseconds(toneVal);
digitalWrite(buzzPin, LOW);
delayMicroseconds(toneVal);
}