示例#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();
 }
 /** occasionally builds a line and prints to output window */
 void Instrument()
 {
     if (--_timeToPrint <= 0)
     {
         _timeToPrint = 20;
         _sb.Clear();
         _sb.Append("pos=");
         _sb.Append(_talon.GetPosition());
         _sb.Append(" vel=");
         _sb.Append(_talon.GetSpeed());
         _sb.Append(" err=");
         _sb.Append(_talon.GetClosedLoopError());
         _sb.Append(" out%=");
         _sb.Append(_talon.GetOutputVoltage() * 100.0f / 12.0f);
         Debug.Print(_sb.ToString());
     }
 }