test program for rotary encoder