byte led_state = 0;
void IRAM_ATTR Ext_INT1_ISR()
{
if(led_state == 0){
led_state = 1;
digitalWrite(35, HIGH);
}
else{
led_state = 0;
digitalWrite(35, LOW);
}
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(2, OUTPUT);
led_state = 0;
digitalWrite(2, LOW);
pinMode(35,INPUT_PULLDOWN);
attachInterrupt(35, Ext_INT1_ISR, RISING);
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}