Go Down

Topic: Sensor RPM without Interrupts (Read 1 time) previous topic - next topic


Hi... I'm working a week ago with Arduino, and I am implementing a speed sensor for 4 bicycles to send the signal to Adobe Flash and connect to a game .... The Atmega328 has only 2 External Interrupts and I need 4, so I'm trying to implement Polling ... the maximum frequency for receiving data from a single cycle is 50Hz (20ms) ... the question is: Polling is feasible to work with these speeds, or I will get the Arduino Mega has 6 external interrupts? hehe ... Thank you very much if anyone can help me with this...
Diego M Toro


Be aware the atmega328 has the ability to set its other pins as interrupts, called the "PCINT" interrupt system I think... I've read somewhere that somebody wrote a library to use these, but I don't have the link off hand.


pin change interrupts indeed

you need to read this - http://arduino.cc/playground/Main/PinChangeInt -
Rob Tillaart

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



I didn't write the pinchangeint library or contribute in anyway but here is a write up on the library -


And an example of using it to read multiple signals which you could adapt to your application


Duane B

Read this
then watch this


Nick Gammon

For fastest response for pin change interrupts (especially if you only need another two) choose pins on different "groups". (eg. PINB and PINC).

Then you can configure an interrupt handler for each one with minimal testing needed as to exactly which pin caused the interrupt.

More info here:

Please post technical questions on the forum, not by personal message. Thanks!

More info:



Thanks everybody... I have been reading the links you sent me and I'm trying to make a 'fusion' of all the info ... this weekend I will work hard and tell them how I was ... (write in English is still difficult for me, and I translate some things on google, but I hope you mean, lol)
Diego M Toro


We understand it perfectly (otherwise we will just ask)
Rob Tillaart

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

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!

via Egeo 16
Torino, 10131