public override void Closed() { base.Closed(); PhidgetsServoBoard board = Interface as PhidgetsServoBoard; if (board != null) { board.Detach(); } }
protected override void OnInterfaceChanged(HeliosInterface oldInterface, HeliosInterface newInterface) { PhidgetsServoBoard oldBoard = oldInterface as PhidgetsServoBoard; if (oldBoard != null) { oldBoard.Detach(); } PhidgetsServoBoard newBoard = newInterface as PhidgetsServoBoard; if (newBoard != null) { newBoard.Attach(); } _motorList.Clear(); for (int i = 0; i < newBoard.ServoCount; i++) { _motorList.Add("Servo " + i); } }