public static int Ordinal(this LED.State s) { int i = 0; foreach (LED.State v in Enum.GetValues(typeof(LED.State))) { if ((int)v == (int)s) { return(i); } i++; } return(-1); }
public static void SetAllLEDSState(LED.State s) { workingLed.myState = s; breakLed.myState = s; freeLed.myState = s; }