balamced gray code on arduino