Added Digital IO control and analog input query

Also restructured ExtArmState to be a else if stack rather than switch
case.