Go Down

Topic: Crumbuino-128 and interrupts problem (Read 794 times) previous topic - next topic

pvdbos

Hello, all.

I use an Crumbuino 128 from chip45.com and I have a strange problem with the interrupts
when I connect two quadrant encoders on port 4 - 7 and 5 - 6 then I must use the INT4 and INT5
to handle the interrupts right!

But this are not working it's only worked with INT0 and INT1

Code:

const int aEncMtrL = 4;        //INT4 interrupt pin
const int bEncMtrL = 7;        //determines the direction of travel
const int aEncMtrR = 5;        //INT5 interrupt pin
const int bEncMtrR = 6;        //determines the direction of travel

attachInterrupt(INT4, encoderISR_L, RISING);   this must by working but it doesn't
attachInterrupt(INT5, encoderISR_R, RISING);

attachInterrupt(INT0, encoderISR_L, RISING);   this working but it's not the right way   
attachInterrupt(INT1, encoderISR_R, RISING);

can someone help my with this were I can find an solution for this.

thanx.

robtillaart

interesting board but no experience with it so all disclaimers apply

I think the problem is that the names of the INT0 and INT1 are "confusing" as they do not refer to the pin but to the interrupt number.

ON the ARduino UNO we also have INT0 and INT1  on pin 2 and 3 so ...
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up