ok so basically leave it there but take the internals out of it.
would this work or am i barking up the wrong tree?
volatile int rpmcount;
int sensorState = 0;
unsigned int rpm;
unsigned long timeold;
int rpm1 =1;
void setup() {
Serial.begin(9600);
pinMode(INPUT, rpm1);
}
void loop(){
if(rpm1>=5) {
rpm=(60000*rpmcount)/(8*(millis()-timeold)); //the 8 changes to 4 if 4 magnets are used.
timeold = millis();
//Serial.println(rpmcount,DEC);
rpmcount = 0;
Serial.println(rpm,DEC);
}
}