void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(2, OUTPUT);
attachInterrupt(digitalPinToInterrupt(2), test, RISING);
}
void test() {
Serial.println("Sucess");
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(2, 1);
delay(500);
digitalWrite(2, 0);
delay(490);
delay(10); // this speeds up the simulation
}