balanced gra code on arduino by using transition sequence