Hi,
In this particular case the difference is that in the example using interrupts the latency is max ~100mS and in the example not using interrupts the latency can be up to 200mS.
In the first example PBP check if there is an interrupt pending between each PBP statement. Basicly:
The second example checks the switch at the begining of each iteration thru the loop and since you have two Pause 100 in there it takes at least 200mS between each check. Depending on when you push the button the time it takes for program to respond will be between 0 and ~200mS.Code:Loop: Interrupt? High LED Interrupt? Pause 100 Interrupt? Low LED Interrupt? Pause 100 Interrupt? Goto Loop
/Henrik Olsson.




Bookmarks