void setup() { } void loop() { if(analogRead(1)<600) { tone(8, analogRead(0)); } else { noTone(8); } }