Java 类edu.wpi.first.wpilibj.SPI.Port 实例源码

项目:2017-emmet    文件:RobotMap.java   
public static void init() {
    driveTrainCIMRearLeft = new CANTalon(2); // rear left motor
    driveTrainCIMFrontLeft = new CANTalon(12); // 
    driveTrainCIMRearRight = new CANTalon(1);
    driveTrainCIMFrontRight = new CANTalon(11);
    driveTrainRobotDrive41 = new RobotDrive(driveTrainCIMRearLeft, driveTrainCIMFrontLeft, 
            driveTrainCIMRearRight, driveTrainCIMFrontRight);
    climberClimber = new CANTalon(3);
    c1 = new Talon(5);
    pDPPowerDistributionPanel1 = new PowerDistributionPanel(0);
    gyro = new ADXRS450_Gyro(Port.kOnboardCS0);
    c2 = new Talon(6);
    ultra = new AnalogInput(0);

    LiveWindow.addSensor("PDP", "PowerDistributionPanel 1", pDPPowerDistributionPanel1);
    LiveWindow.addSensor("Ultra", "Ultra", ultra);
   //  LiveWindow.addActuator("Intake", "Intake", intakeIntake);
    LiveWindow.addActuator("Climber", "Climber", climberClimber);
    LiveWindow.addActuator("RearLeft (2)", "Drivetrain", driveTrainCIMRearLeft);
    LiveWindow.addActuator("FrontLeft (12)", "Drivetrain", driveTrainCIMFrontLeft);
    LiveWindow.addActuator("RearRight (1)", "Drivetrain", driveTrainCIMRearRight);
    LiveWindow.addActuator("FrontRight (11)", "Drivetrain", driveTrainCIMFrontRight);
    LiveWindow.addActuator("Drive Train", "Gyro", gyro);
    // LiveWindow.addActuator("Shooter", "Shooter", shooter1);
}
项目:Cogsworth    文件:DriveSubsystem.java   
public DriveSubsystem() {
    talonFrontLeft = new CANTalon(Ports.FRONT_LEFT_MOTOR);
    talonFrontRight = new CANTalon(Ports.FRONT_RIGHT_MOTOR);
    talonBackLeft = new Talon(Ports.BACK_LEFT_MOTOR);
    talonBackRight = new Talon(Ports.BACK_RIGHT_MOTOR);
    ultraSanic.setAutomaticMode(true);

    talonFrontLeft.setFeedbackDevice(FeedbackDevice.QuadEncoder);
    talonFrontRight.setFeedbackDevice(FeedbackDevice.QuadEncoder);
    talonFrontLeft.configEncoderCodesPerRev(PulsesPerRevolution);
    talonFrontRight.configEncoderCodesPerRev(PulsesPerRevolution);

    try {
        ahrs = new AHRS(Port.kMXP);
    } catch (Exception ex) {
        //System.out.println(ex);
    }
    // SPEED MODE CODE
    // setDriveControlMode(TalonControlMode.Speed);
    drivingStraight = false;
    driveLowerSpeed = false;
    reversed = true;
    enableForwardSoftLimit(false);
    enableReverseSoftLimit(false);
}
项目:Frc2017FirstSteamWorks    文件:FrcAHRSGyro.java   
public FrcAHRSGyro(final String instanceName, Port port)
{
    super(instanceName, 3, GYRO_HAS_X_AXIS | GYRO_HAS_Y_AXIS | GYRO_HAS_Z_AXIS, null);

    if (debugEnabled)
    {
        dbgTrace = new TrcDbgTrace(moduleName + "." + instanceName, tracingEnabled, traceLevel, msgLevel);
    }

    this.ahrs = new AHRS(port);
}
项目:RA17_RobotCode    文件:Robot.java   
@Override
public void robotInit()
{
    timer = new Timer();
    logger = new DataLogger();
    pdp = new PowerDistributionPanel(20);
    redLED = new Solenoid(0);
    whiteLED = new Solenoid(1);
    scopeToggler = new ScopeToggler(0,1);
    Config.loadFromFile("/home/lvuser/config.txt");
    ////////////////////////////////////////////////
    try
    {
        navx = new LoggableNavX(Port.kMXP);
    }
    catch (RuntimeException ex )
    {
           DriverStation.reportError("Error instantiating navX MXP:  " + ex.getMessage(), true);
    }
    ////////////////////////////////////////////////
    FRe = new AnalogInput(0);
    FLe = new AnalogInput(isCompetition() ? 1 : 2);
    BRe = new AnalogInput(3);
    BLe = new AnalogInput(isCompetition() ? 2 : 1);
    FR = new CANTalon(1);
    FRa = new CANTalon(5);
    FL = new CANTalon(isCompetition() ? 2 : 3);
    FLa = new CANTalon(isCompetition() ? 6 : 7);
    BR = new CANTalon(4);
    BRa = new CANTalon(8);
    BL = new CANTalon(isCompetition() ? 3 : 2);
    BLa = new CANTalon(isCompetition() ? 7 : 6);
    drive = new SwerveDrive(FR, FRa, FRe, FL, FLa, FLe, BR, BRa, BRe, BL, BLa, BLe);
    ////////////////////////////////////////////////
    driver = new XboxController(4);
    op = new XboxController(0);
    ////////////////////////////////////////////////
    driveMode = new EdgeDetect();
    collection = new EdgeDetect();
    ////////////////////////////////////////////////
    cameraSource = new FakePIDSource();
    driveOutput = new FakePIDOutput();
    driveAimer = new PIDController(Config.getSetting("AutoAimP", 0.12),
                                   Config.getSetting("AutoAimI", 0.00),
                                   Config.getSetting("AutoAimD", 0.00),
                                   cameraSource,
                                   driveOutput);
    driveAimer.setInputRange(-24,24);
    driveAimer.setOutputRange(-.3,.3);
    driveAimer.setAbsoluteTolerance(.5);
    ////////////////////////////////////////////////
    climber = new Climber(0, 1);
    ////////////////////////////////////////////////
    gear = new GearPlacer(2);
    Config.addConfigurable(gear);
    ////////////////////////////////////////////////
    manip = new Manipulation(3,4,22);

    shooter = new Shooter(new CANTalon(10));
    Config.addConfigurable(shooter);

    carousel = new Carousel(new CANTalon(9));
    Config.addConfigurable(carousel);

    ReloadConfig();
}
项目:RA17_RobotCode    文件:LoggableNavX.java   
public LoggableNavX(Port spi_port_id)
{
    super(spi_port_id);
}
项目:2017-emmet    文件:RobotMap.java   
public static void init() {
    // DRIVETRAIN MOTORS \\
    drivetrainCIMRearLeft = new CANTalon(2);
    drivetrainCIMFrontLeft = new CANTalon(12);
    drivetrainCIMRearRight = new CANTalon(1);
    drivetrainCIMFrontRight = new CANTalon(11);
    LiveWindow.addActuator("Drivetrain", "RearLeft(2)", drivetrainCIMRearLeft);
    LiveWindow.addActuator("Drivetrain", "FrontLeft(12)", drivetrainCIMFrontLeft);
    LiveWindow.addActuator("Drivetrain", "RearRight(1)", drivetrainCIMRearRight);
    LiveWindow.addActuator("Drivetrain", "FrontRight(11)", drivetrainCIMFrontRight);

    // DRIVE \\
    drivetrainRobotDrive41 = new RobotDrive(drivetrainCIMRearLeft, drivetrainCIMFrontLeft, 
            drivetrainCIMRearRight, drivetrainCIMFrontRight);

    // DRIVE SENSORS \\
    gyro = new ADXRS450_Gyro(Port.kOnboardCS0);
    // accel = new BuiltInAccelerometer();
    enc = new Encoder(9, 8);
    LiveWindow.addSensor("Drive Sensors", "Gyro", gyro);
    // LiveWindow.addSensor("Drive Sensors", "Accelerometer", accel);
    LiveWindow.addSensor("Drive Sensors", "Encoder", enc);

    // CLIMB \\
    climber = new Talon(5);
    climber2 = new Talon(6);
    LiveWindow.addActuator("Climber", "Climber", climber);
    LiveWindow.addActuator("Climber", "Climber2", climber2);

    // GEAR \\
    claw = new CANTalon(3);
    LiveWindow.addActuator("Gear", "Claw", claw);

    // FUEL \\
    // shooter = new Talon(6);
    // LiveWindow.addActuator("Fuel", "Shooter", shooter);

    // DIAGNOSTIC \\
    pdp = new PowerDistributionPanel(0);
    LiveWindow.addSensor("PDP", "Power Distribution Panel", pdp);

}
项目:2017-emmet    文件:RobotMap.java   
public static void init() {
    // DRIVETRAIN MOTORS \\
    drivetrainCIMRearLeft = new CANTalon(2);
    drivetrainCIMFrontLeft = new CANTalon(12);
    drivetrainCIMRearRight = new CANTalon(1);
    drivetrainCIMFrontRight = new CANTalon(11);
    LiveWindow.addActuator("Drivetrain", "RearLeft(2)", drivetrainCIMRearLeft);
    LiveWindow.addActuator("Drivetrain", "FrontLeft(12)", drivetrainCIMFrontLeft);
    LiveWindow.addActuator("Drivetrain", "RearRight(1)", drivetrainCIMRearRight);
    LiveWindow.addActuator("Drivetrain", "FrontRight(11)", drivetrainCIMFrontRight);

    // DRIVE \\
    drivetrainRobotDrive41 = new RobotDrive(drivetrainCIMRearLeft, drivetrainCIMFrontLeft, 
            drivetrainCIMRearRight, drivetrainCIMFrontRight);

    // DRIVE SENSORS \\
    gyro = new ADXRS450_Gyro(Port.kOnboardCS0);
    // accel = new BuiltInAccelerometer();
    enc = new Encoder(0, 1);
    LiveWindow.addSensor("Drive Sensors", "Gyro", gyro);
    // LiveWindow.addSensor("Drive Sensors", "Accelerometer", accel);
    LiveWindow.addSensor("Drive Sensors", "Encoder", enc);

    // CLIMB \\
    climber = new Talon(5);
    climber2 = new Talon(6);
    LiveWindow.addActuator("Climber", "Climber", climber);
    LiveWindow.addActuator("Climber", "Climber2", climber2);

    // GEAR \\
    claw = new CANTalon(3);
    LiveWindow.addActuator("Gear", "Claw", claw);

    // FUEL \\
    shooter = new Talon(6);
    LiveWindow.addActuator("Fuel", "Shooter", shooter);

    // DIAGNOSTIC \\
    pdp = new PowerDistributionPanel(0);
    LiveWindow.addSensor("PDP", "Power Distribution Panel", pdp);

}
项目:thirdcoast    文件:GyroModule.java   
@Provides
@Singleton
public static AHRS provideGyro() {
  return new AHRS(Port.kMXP);
}