int button1 = 15;
int button2 = 2;
void setup() {
pinMode(button1, INPUT);
pinMode(button2, INPUT);
Serial.begin(9600);
Serial.println("Hello, ESP32!");
}
void loop() {
int button1_state = digitalRead(button1);
int button2_state = digitalRead(button2);
if (button1_state == LOW)
{
Serial.println("button 1 is pressed");
delay(200);
}
if (button2_state == HIGH)
{
Serial.println("button 2 is pressed");
delay(200);
}
}