Arduino code for encoder tester