Exemple #1
0
 //reads the talons and updates the data
 public void updateStatusData()
 {
     talonCurrent             = (talon.GetOutputCurrent());
     talonTemperature         = (talon.GetTemperature());
     talonVoltage             = (talon.GetOutputVoltage());
     talonSpeed               = (talon.GetSpeed());
     talonPosition            = (talon.GetPosition());
     talonSetpoint            = (talon.GetSetpoint());
     talonForwardLimitReached = talon.IsFwdLimitSwitchClosed() ? 1 : 0;
     talonReverseLimitReached = talon.IsRevLimitSwitchClosed() ? 1 : 0;
     controlMode              = talon.GetControlMode();
 }
        static void Run()
        {
            float x = _gamepad.GetAxis(1);

            Deadband(ref x);

            //Set the Maximum Current Limit for the Talon (in Amps)
            talon.SetCurrentLimit(10);
            //Enable the Current Limiting Feature.
            talon.EnableCurrentLimit(true);

            talon.Set(x);

            float current = talon.GetOutputCurrent();

            stringBuilder.Append("\t");
            stringBuilder.Append(current);
            stringBuilder.Append("\t");
        }