UKHeliBob:
You can use pin change interrupts PinChangeInterrupt which give you more pins to use than hardware interrupts but first I think you should explain why you think that you need more than 2 interrupts, or indeed any interrupts.
Can you please provide a link to the sensors you are using.
Here's the link to the sensor, although it's not exactly the one I bought.
I'm uploading here a code of how I am using the hall effect sensors by a interrupt routine.
volatile byte half_revolutions;
unsigned int rpm;
unsigned long timeold;
void setup()
{
Serial.begin(9600);
attachInterrupt(0, magnet_detect, RISING);//Initialize the intterrupt pin (Arduino digital pin 2)
half_revolutions = 0;
rpm = 0;
timeold = 0;
}
void loop()//Measure RPM
{
if (half_revolutions >= 2)
{
rpm = 30*1000/(millis() - timeold)*half_revolutions;
timeold = millis();
half_revolutions = 0;
Serial.println(rpm,DEC);
}
}
void magnet_detect()//This function is called whenever a magnet/interrupt is detected by the arduino
{
half_revolutions++;
}
using more than 2 pins for interrupt will help me use 3 sensors ( which i'm thinking to use in the same way as the single one i am using above).
Thanks for the help!