int potPin = A0;
int buz=10;
int Val= 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode (buz, OUTPUT);
pinMode (potPin, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
Val= analogRead(potPin);
tone (buz, Val);
float voltage= Val*(5.0/1023.0);
Serial.println(voltage);
}