Go Down

Topic: how to set up an interrupt service routine? (Read 796 times) previous topic - next topic

fallen

Mar 30, 2006, 08:10 am Last Edit: Mar 30, 2006, 08:11 am by fallen Reason: 1
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 !

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy