Information System setup help (encoder, reset, switch, display)

I'm relatively new to micro-controller programming and recently decided to use an Arduino for a simple project. I was wondering if someone can help me or direct me to relevant links on this forum. My Arduino UNO (rev2) project is to make a system that consists of:

  1. single encoder (Alps SRGPSJ) glued to a wheel to measure rotations of the wheel in order to find the distance it goes.

  2. a display to show the distance(s). For prototyping, I'm using a 4 digit seven-segment display (HDSP-B0xE). Some have suggested that an LCD may be easier, so I've ordered two of these for later use:
    http://arduino.cc/en/Tutorial/LiquidCrystal
    (1602 Character LCD Display Module HD44780)

  3. An actuation switch (Honeywell V15T16-CZ300A03-K) to indicate to the system to record the distance when switched on

  4. A reset button (Mountain 103-1218-EVX) for resetting the distance count.

I've gotten the encoder to display some signals, but not all and I suspect it may need debouncing, as indicated to me here:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1205879808/all

A sample of my code is:

/* Encoder Test Code 1 */

int EncA = 7;
int EncB = 8;
int EncPos = 0;
int EncALast = LOW;
int n = LOW;
int Rev = 0;

void setup () {
  pinMode (EncA, INPUT);
  pinMode (EncB, INPUT);
  Serial.begin (9600);
}

void loop () {
  n = digitalRead(EncA);
  if ((EncALast == LOW) && (n == HIGH)){
    if (digitalRead(EncB) == LOW) {
      EncPos--;
    } else {
      EncPos++;
    }
    
    Rev = EncPos/16;
    Serial.print (EncPos
    
    
    
    );
    Serial.print ("/");
  }
  EncALast = n;
}

Any help is greatly appreciated, as I'm somewhat clueless on how to connect some of these devices together to make the system work. Also, if possible, let me know where I need resistors or transistors, or any other component.

I've done a search on some of these devices and they've given me different information. Thanks!!

The problem may be that Serial.print() takes a significant amount of time so you may be missing pulses. One way to prevent that would be to use the interrupt capability of the Arduino to detect changes in one of the two quadrature inputs. See more here: Arduino Playground - RotaryEncoders

Thanks for the reply!

Actually, the debouncing code on that page you suggested seems to work the best. I'll keep the serial.print command for now, as the encoder isn't spinning that fast for the program command the miss the pulses.

What's a good schematic to putting everything together?