const int PIN_BUZZ = 3;
const int PIN_POT = A0;
float potValue;
float buzzValue;
void setup() {
pinMode(PIN_BUZZ, OUTPUT);
pinMode(PIN_POT, INPUT);
Serial.begin(9600);
}
void loop() {
potValue = analogRead(PIN_POT) / 1023.0;
buzzValue = potValue * 7902;
tone(PIN_BUZZ, buzzValue);
Serial.print(potValue);
Serial.print(" ");
Serial.println(buzzValue);
}