cattledog:
interrupt 0 is pin2 and interrupt 1 is pin 3 on the uno.Back up a bit, and write a a piece of code which just reads the encoder and writes the count to the screen.
How are you planning to use the encoder counts in your program?
The motor code is "blocking" and this section will prevent other things from happening
Does this means i have to change the interrupt value to 7 and 8 respectively? Thank you for the guidance on "blocking". I do not know of that at all.
groundFungus:
I assume a rotary encoder with switch outputs like in this tutorial. Do you have the pullup resistors installed (no way to tell from the photo). If you enable the internal pullup resistors you won't need add them.
Use pinMode(pin, INPUT_PULLUP).And the 500 ms delay in every iteration of loop() degrades responsiveness. The millis() for timing guide will help you get rid of delays.
I'm not sure if a pullup resistor is installed or not cause it's a RepRap Full Graphic Smart Controller LCD unit which has the encoder directly. Thanks for the millis timing guide!
Robin2:
What you are trying to achieve will require care to ensure that no part of the program blocks any other part. For example the motor movements must not block the encoder and neither must the updating of the display block the stepper motor or the encoder.Have a look at the non-blocking stepper code in the second example in this Simple Stepper Code
...R
Stepper Motor Basics
Thanks for the reference link! I was trying to build a barn door tracker with custom menu. That's why i wanted to have the encoder to select from the menu system.