Basic arduino sketch to get a rotary encoder outputtng "gray code" via an interrupt