Example #1
0
        public void OnSaved(WpfConfiguration configurationControl)
        {
            var config = configurationControl as Phidget1066AdvServoConfig;

            servoType = config.ServoType;
            position  = config.Position;
        }
Example #2
0
        protected override void OnLoadDefaults()
        {
            position = 50;
            index    = 0;

            // This is the one we have, so we are just defaulting to it
            servoType = ServoServo.ServoType.HITEC_HS322HD;
        }
Example #3
0
        public Phidget1066AdvServoConfig(int index, ServoServo.ServoType servoType, double position)
        {
            Index     = index;
            ServoType = servoType;
            Position  = position;

            InitializeComponent();
        }
 internal void SetServoProperties(int servoNumber, ServoServo.ServoType type, double minPulse, double maxPulse, double maxVelocity, double travel)
 {
     if (_servoBoard != null && _servoBoard.Attached)
     {
         double degrees = (maxPulse - minPulse) / travel;
         if (type == ServoServo.ServoType.USER_DEFINED)
         {
             _servoBoard.servos[servoNumber].setServoParameters(minPulse, maxPulse, degrees, degrees * maxVelocity);
         }
         else
         {
             _servoBoard.servos[servoNumber].Type = type;
         }
         _servos[servoNumber].Calibration.OutputLimitMax = travel > 0 ? travel : 0.001;
         _servos[servoNumber].Calibration.OutputLimitMin = 0.0;
     }
 }