The Arduino code used cycling state system. The push of a button would cause a variable to cycle from 0 to 1. There were several states that the toy would cycle thru, (a) off in up position, (b) static on in up position, (c) on with arm descending, (d) static on in down position, (e) and on with arm ascending. If the button variable was clicked from 0 to 1 this would case the states to change to a for (b) set amount of time, (c) until a servo angle was achieved, (d) on a loop until the button variable changes or the toy times out. When button variable changes back from 1 to 0, it would actuate states (e) until a servo angle was reached and then (b) for a set time and then (a)