finished writing codes to test knob direction