hugoalves6:
Hum, I read somewhere, that I must do that so that it doesn't count false inputs while calculating, removing it should work for the RPM sensor then?
You should do that while accessing the variable that is changed in the interrupt but you should keep that to the absolute minimum that is possible, otherwise it will not register any single event.
So the start of your loop should look something like this:
detachInterrupt(0);
uint32_t cpulses = pulses;
pulses = 0;
attachInterrupt(digitalPinToInterrupt(engineSensorPin), counter, FALLING);
RPM = (60 * 1000 / pulsesPerTurn) / (millis() - timeOld) * cpulses;
timeOld = millis();