I am trying to simulate an interrupt with an Arduino Uno in Proteus. This is the simple test code that I'm using:
void introutine()
{
digitalWrite(13,HIGH);
}
void setup()
{
pinMode(13,OUTPUT);
attachInterrupt(2,introutine,LOW);
}
void loop()
{
}
Here's the circuit in Proteus:
When I hit the button, the LED is supposed to turn on. Well, nothing happens. I have read something about Proteus being bad at simulating interrupts, but I'm not sure about it because Timer1 interrupts did work well. Basically, the problem lies within EXTERNAL interrupts only. I hope you people can help me.
Thank you.
LOW
inattachInterrupt
instead ofRISING
? Also, instead of putting some kind of correction about IO13 vs IO2 in a comment, please edit that info into the question. Also, the phrasing “Suppose it says IO2, and still it will not work” asks us to imagine it doesn't work when you correct the pin number. Rather than asking us to imagine that's the case, why not go ahead and test it and then edit the question to say what the effect of the change was? – James Waldby - jwpat7 Mar 28 '16 at 1:34