void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(27, INPUT);
pinMode(4, OUTPUT);
}
void loop() {
int slide=digitalRead(27);
if(slide==1)
tone(4,1200);
else
noTone(4);
// put your main code here, to run repeatedly:
delay(100); // this speeds up the simulation
}