int potpin = A5;
int potpinA4 = A4;
int delaypot = 500;
int potval = 0;
void setup() {
Serial.begin(9600);
// put your setup code here, to run once:
pinMode(8, OUTPUT);
pinMode(1, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
delaypot = analogRead(potpinA4);
potval = analogRead(potpin);
if (potval) {
tone(8, potval);
}
Serial.println(potval);
tone(1, 500);
delay(delaypot);
noTone(1);
}