Arduino Uno with Rotary Encoder to measure RPM

I need to make a tachometer for my capstone class, I have never used arduino before. But I have been playing around and it is pretty cool what they can do.

Arduino Uno
Rotary Encoder (24 clicks per rotation)
Small DC Motor

Use rotary encoder to measure RPMs of a small DC motor, and display it on the LCD screen.

This code is from Arduino RPM Counter / Tachometer

int ledPin = 13; // IR LED connected to digital pin 13
volatile byte rpmcount;
unsigned int rpm;
unsigned long timeold;

// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8,9,4,5,6,7);

void rpm_fun()
//Each rotation, this interrupt function is run twice, so take that into consideration for
//calculating RPM
//Update count

void setup()
lcd.begin(16, 2); // intialise the LCD

//Interrupt 0 is digital pin 2, so that is where the IR detector is connected
//Triggers on FALLING (change from HIGH to LOW)
attachInterrupt(0, rpm_fun, FALLING);

//Turn on IR LED
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, HIGH);

rpmcount = 0;
rpm = 0;
timeold = 0;

void loop()
//Update RPM every second
//Don’t process interrupts during calculations
//Note that this would be 60*1000/(millis() - timeold)rpmcount if the interrupt
//happened once per revolution instead of twice. Other multiples could be used
//for multi-bladed propellers or fans
rpm = 60
1000/(millis() - timeold)*rpmcount;
timeold = millis();
rpmcount = 0;

//Print out result to lcd

//Restart the interrupt processing
attachInterrupt(0, rpm_fun, FALLING);

I do not understand how the programming will work with the rotary encoder, how will the interrupts work.
I cannot use an IR tachometer

Please do not be to critical on me as this is the first time using arduino

You should probably break the task into bits and put the bits together at the end. You need to control a motor. One direction of rotation or forward and reverse? in either case you will need some sort of controller be it a motor shield, driver chip or just a transistor and a diode. You need to get pulses from the encoder and count the pulses. Then learn how to use millis() and micros() to time events (pulses per unit time). Then figure out interfacing and controlling the LCD. Pick one task and try to figure it out. If you have trouble post a question about a narrower topic than how to measure RPM. Include the code that is giving trouble and specs (or better, links to datasheets) of the hardware.

fugitive87: I do not understand how the programming will work with the rotary encoder, how will the interrupts work.

Well, there's the first problem, you mentioned "interrupts".

From where did you get the idea of "interrupts"? I think you need to forget all about interrupts until you address a program where they are appropriate - this is certainly not one.

As "groundfungus" points out, your programming task, is to write a loop which alternately looks for a change in the status of the encoder sensor (for speed measurement, you only need one of the two sensors)and checks the time by the "millis()" function. If the encoder was mechanical (though you would not use a mechanical encoder to measure PM on a motor shaft - it would wear out too rapidly) you would need to consider contact "bounce"; optical and Hall encoders generally incorporate hysteresis to avoid such problems.

So you have your loop code counting events and comparing the time to a pre-determined time at which to cease counting. When this occurs, you switch to alternative code to scale and display the RPM value derived from that count.

fugitive87: Use rotary encoder to measure RPMs of a small DC motor, and display it on the LCD screen.

A rotary encoder typically means something that generates a large number of signal changes per revolution, and a small DC motor typically implies something with a large RPM range. What is the maximum frequency of encoder signal changes that you need to deal with i.e. maximum motor speed times number of signal changes per revolution?