Pages: [1]   Go Down
Author Topic: how to set up an interrupt service routine?  (Read 732 times)
0 Members and 1 Guest are viewing this topic.
China
Offline Offline
Jr. Member
**
Karma: 0
Posts: 60
I love Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi ! I see a post here : http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1143470863
Oliver Keller say :"I set up an external interrupt service routine, that's listening on pin 8 (the only pin that can do that on an arduino board). "

I very want a way to set up an interrupt service routine in Arduino ( timer interrupt and external interrupt ) I see his code :
<code>
void irHandler(void){
// external interrupt service routine

  timeL = ICR1L;  // read time since last reset
  timeH = ICR1H;
  pattern[count]= (timeH << 8 ) | timeL;
  //pattern[count] = millis();   //another attemp, I don't which is more clever
  count++;
  somethingHappend = 1;
}

timerAttach(TIMER1INPUTCAPTURE_INT, irHandler); //attach service routine
</code>

but I can't find the cmd "timerAttach" in Arduino , Is there a way to set up an interrupt service routine?
if somebody know that , could you tell me a example ? thank you !

and I see the PinMapping : http://www.arduino.cc/en/Main/PinMapping
the int0 and int1 is pin2 pin3  , how to use them , and why Oliver Keller say :"that's listening on pin 8 (the only pin that can do that on an arduino board). "?

thank you !
« Last Edit: March 30, 2006, 01:11:57 am by fallen » Logged

Pages: [1]   Go Up
Jump to: