Check out these topics:
http://arduino.cc/en/Reference/Map
http://arduino.cc/playground/Main/ReadingRPM