int btnpin1 = 23;
int btnpin2 = 22;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("Hello, ESP32!");
pinMode(btnpin1, INPUT);
pinMode(btnpin2, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int btnState1 = digitalRead(btnpin1);
int btnState2 = digitalRead(btnpin2);
if(btnState1 == HIGH){
delay(100);
Serial.println("Button is pressed Active high");
}
if(btnState2 == LOW){
delay(100);
Serial.println("Button is pressed active low");
}
delay(200); // this speeds up the simulation
}