微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

edu.wpi.first.wpilibj.AnalogChannel的实例源码

项目:2014_Main_Robot    文件Winch.java   
/**
 * A private constructor to prevent multiple instances from being created.
 */
private Winch(){
    winchMotor = new Talon(RobotMap.winchMotor.getInt());
    winchInputSwitch = new DigitalInput(RobotMap.winchLimitSwitch.getInt());
    winchSolenoid = new MomentaryDoubleSolenoid(
            RobotMap.winchExtPort.getInt(),RobotMap.winchRetPort.getInt());
    winchBallSensor = new AnalogChannel(RobotMap.winchBallSensorPort.getInt());
    intakeBallSensor = new AnalogChannel(RobotMap.intakeBallSensorPort.getInt());
    ballPresent = new Debouncer(RobotMap.ballPresentTime.getDouble());
    ballNotPresent = new Debouncer(RobotMap.ballPresentTime.getDouble());
    ballSettled = new Debouncer(RobotMap.ballSettleTime.getDouble());
    ballPresentOnWinch = new Debouncer(RobotMap.ballPresentOnWinchTime.getDouble());

    winchPotentiometer =
            new AnalogChannel(RobotMap.potentiometerPort.getInt());
    winchEncoder = new AverageEncoder(
            RobotMap.winchEncoderA.getInt(),RobotMap.winchEncoderB.getInt(),RobotMap.winchEncoderpulsePerRot,RobotMap.winchEncoderdistPerTick,RobotMap.winchEncoderReverse,RobotMap.winchEncodingType,RobotMap.winchSpeedReturnType,RobotMap.winchPosReturnType,RobotMap.winchAvgEncoderVal);
    winchEncoder.start();
}
项目:4500-2014    文件Robottemplate.java   
public void robotinit(){
    driveStick= new JoyStickCustom(1,DEADZONE);
    secondStick=new JoyStickCustom(2,DEADZONE);

    frontLeft= new Talon(1);
    rearLeft= new Talon(2);
    frontRight= new Talon(3);
    rearRight= new Talon(4);

    timer=new Timer();
    timer.start();

    armM = new Victor(7);
    rollers =new Victor(6);

    mainDrive=new RobotDrive(frontLeft,rearLeft,frontRight,rearRight);

    mainDrive.setInvertedMotor(RobotDrive.MotorType.kFrontRight,true);
    mainDrive.setInvertedMotor(RobotDrive.MotorType.kRearRight,true);

    armP = new AnalogPotentiometer(1);
    distance= new AnalogChannel(2);
    ultra=new Ultrasonic(6,7);
    ultra.setAutomaticMode(true);

    compress=new Compressor(5,1);

    handJoint=new Pneumatics(3,4);

    //ultra = new Ultrasonic(6,5);
    //ultra.setAutomaticMode(true);

    winch = new Winch(secondStick);

}
项目:TitanRobot2014    文件InfraredSwitch.java   
public InfraredSwitch(int pInfraredDetectorChannel,AnalogChannel pAnalogVoltageMeter,double pHammerLevel,int pOnState,boolean pForceStateChange) {
    infraredDetector = new AnalogChannel(pInfraredDetectorChannel);
    analogVoltageMeter = pAnalogVoltageMeter;
    hammerLevel = pHammerLevel;
    onState = pOnState;
    setForceStateChange(pForceStateChange);
}
项目:TitanRobot2014    文件Potentiometer.java   
public Potentiometer(int pPotentiometerChannel,boolean pReverse) {
    potentiometer = new AnalogChannel(pPotentiometerChannel);
    analogVoltageMeter = pAnalogVoltageMeter;
    scaled = false;
    scale = 0.0;
    minValue = 0.0;
    maxValue = 0.0;
    reverse = pReverse;
}
项目:TitanRobot2014    文件Potentiometer.java   
public Potentiometer(int pPotentiometerChannel,boolean pReverse,double pScale,double pMinValue,double pMaxValue) {
    potentiometer = new AnalogChannel(pPotentiometerChannel);
    analogVoltageMeter = pAnalogVoltageMeter;
    scaled = true;
    scale = pScale;
    minValue = pMinValue;
    maxValue = pMaxValue;
    reverse = pReverse;
}
项目:FRC2014    文件Sensors.java   
public Sensors() {
    //initializing everything
    rightDriveEncoder = new Encoder(4,3);
    leftDriveEncoder = new Encoder(2,1);
    leftRangeFinder = new AnalogChannel(1,1);
    rightRangeFinder = new AnalogChannel(1,2);
    rightDriveEncoder.setdistancePerpulse(.08168);
}
项目:2014-Robot    文件DiagnosticRobot.java   
public void robotinit(){
    analog = new AnalogChannel(4);
    joystick = new LogitechPro(1);
    attack = new LogitechAttack(2);
    leftMotor = new Motor(1,"Jaguar Speed Controller");
    rightMotor = new Motor(2,"Jaguar Speed Controller");
    drive = new DriveTrain(leftMotor,rightMotor);
}
项目:2014-Robot    文件Throttle.java   
public Throttle( String name,int sliderChannel,double voltageRange,int percentChangeBeforeDetection ) {
    this.name = name;
    this.slider = new AnalogChannel(sliderChannel);
    this.voltageRange = Math.abs(voltageRange);
    this.speedChangeBeforeDetection = inRange(percentChangeBeforeDetection / 100);
}
项目:Staley-Robotics-2014    文件RobotMap.java   
public static void init()
{

driveTrainRightVictor = new Victor(1,1);
driveTrainLeftVictor = new Victor(1,3);
loaderVictor = new Victor(1,2);
CatapultVictor = new Victor(1,4);  

FireSolenoidSpike = new Relay(2);
PrimeSolenoidSpike = new Relay(3);
lightSpike = new Relay(7);
compressorSpike = new Relay(8);

gyro = new Gyro(1);
ultrasonic = new AnalogChannel(3);

limitSwitch = new DigitalInput(3);
pressureSwitch = new DigitalInput(2);

LiveWindow.addActuator("Drive Train","Right Victor",(Victor) driveTrainRightVictor);
LiveWindow.addActuator("Drive Train","Left Victor",(Victor) driveTrainLeftVictor);

robotDriveTrain = new RobotDrive(driveTrainLeftVictor,driveTrainRightVictor);

robotDriveTrain.setSafetyEnabled(true);
robotDriveTrain.setExpiration(0.1);
robotDriveTrain.setSensitivity(0.5);
robotDriveTrain.setMaxOutput(1.0);
}
项目:2014_Main_Robot    文件FalconGyro.java   
/**
 * Gyro constructor with a precreated analog channel object. Use this
 * constructor when the analog channel needs to be shared. There is no
 * reference counting when an AnalogChannel is passed to the gyro.
 * 
 * @param channel
 *            The AnalogChannel object that the gyro is connected to.
 */
public FalconGyro(AnalogChannel channel) {
    m_analog = channel;
    if (m_analog == null) {
        System.err
                .println("Analog channel supplied to Gyro constructor is null");
    } else {
        m_channelAllocated = false;
        initGyro();
    }
}
项目:FRC623Robot2014    文件RobotHardware.java   
public RobotHardware() {
    try {
        // Initializes the Jaguar motor controllers for driving
        CANJaguar frontLeftJaguar = new CANJaguar(Constants.FRONT_LEFT_MOTOR_PORT);
        CANJaguar backLeftJaguar = new CANJaguar(Constants.BACK_LEFT_MOTOR_PORT);
        CANJaguar frontRightJaguar = new CANJaguar(Constants.FRONT_RIGHT_MOTOR_PORT);
        CANJaguar backRightJaguar = new CANJaguar(Constants.BACK_RIGHT_MOTOR_PORT);

        // Initializes the controller for the four driving motors and reverses two of them
        driveControl = new RobotDrive(frontLeftJaguar,backLeftJaguar,frontRightJaguar,backRightJaguar);
        driveControl.setInvertedMotor(RobotDrive.MotorType.kFrontRight,true);
        driveControl.setInvertedMotor(RobotDrive.MotorType.kRearRight,true);
    } catch (CANTimeoutException ex) {
        ex.printstacktrace();
    }

    // Initialize joysticks
    driverJoystick = new Joystick(Constants.DRIVER_JOYSTICK_PORT);
    secondJoystick = new Joystick(Constants.SECOND_JOYSTICK_PORT);

    sonar = new AnalogChannel(Constants.ANALOG_SONAR_PORT);

    compressor = new Compressor(Constants.COMPRESSOR_PRESSURE_SWITCH_CHANNEL,Constants.COMPRESSOR_RELAY_CHANNEL);
    doubleSol = new DoubleSolenoid(Constants.DOUBLE_SOLENOID_FORWARD_CHANNEL,Constants.DOUBLE_SOLENOID_REVERSE_CHANNEL);
    sol1 = new Solenoid(Constants.soLENOID_PORT_1);
    sol2 = new Solenoid(Constants.soLENOID_PORT_2);
}
项目:RobotBlueTwilight2013    文件Piston.java   
public Piston(int extendPort,int retractPort,int readerport){
    extend = new Solenoid(extendPort);
    retract = new Solenoid(retractPort);
    isSolenoid = true;
    pressureReaderport = readerport;
    ai = new AnalogChannel(pressureReaderport);
}
项目:GearsBot    文件Elevator.java   
public Elevator() {
    super("Elevator",Kp,Ki,Kd);

    motor = new Jaguar(RobotMap.elevatorMotor);
    pot = new AnalogChannel(RobotMap.elevatorPot);

    // Set default position and start PID
    setSetpoint(STOW);
    enable();
}
项目:GearsBot    文件Wrist.java   
public Wrist() {
    super("Wrist",Kd);
    motor = new Victor(RobotMap.wristMotor);
    pot = new AnalogChannel(RobotMap.wristpot);

    // Set the starting setpoint and have PID start running in the background
    setSetpoint(STOW);
    enable(); // - Enables the PID controller.
}
项目:Hyperion3360-2012    文件Canon.java   
public Canon(ReserveBallon reserve) {
    mReserve = reserve;
    mjControl = JoystickDevice.Getcopilot();
    mjAngleDeTir = new Jaguar(PwmDevice.mCanonAngleDeTir);
    mfAngleDeTir = new FiltrePasseBas(25);
    mjOrientationDeTir = new Jaguar(PwmDevice.mCanonorientationDeTir);
    mfOrientationDeTir = new FiltrePasseBas(25);
    msTir = new Solenoid(SolenoidDevice.mCanonTir);
    msTirRev = new Solenoid(SolenoidDevice.mCanonTirRev);

    mdLimiteRotationGauche = new DigitalInput(DigitalDevice.mCanonLimiteRotationGauche);
    mdLimiteRotationDroite = new DigitalInput(DigitalDevice.mCanonLimiteRotationDroite);

    mjCanonHaut = new Jaguar(PwmDevice.mCanonMoteurHaut);
    mfCanonHaut = new FiltrePasseBas(25);
    macCanonHaut = new AnalogChannel(AnalogDevice.mCanonMoteurHaut);
    mpidCanonHaut = new PIDController(Kp,Kd,macCanonHaut,mjCanonHaut);
    mpidCanonHaut.setInputRange(0.0,4095.0);
    mpidCanonHaut.setoutputRange(-1.0,1.0);

    mjCanonBas = new Jaguar(PwmDevice.mCanonMoteurBas);
    mfCanonBas = new FiltrePasseBas(25);
    macCanonBas = new AnalogChannel(AnalogDevice.mCanonMoteurBas);
    mpidCanonBas = new PIDController(Kp,macCanonBas,mjCanonBas);
    mpidCanonBas.setInputRange(0.0,4095.0);
    mpidCanonBas.setoutputRange(-1.0,1.0);

    mRangeFinder = new RangeFinder(5);

    maAngle = new ADXL345_I2C(1,ADXL345_I2C.DataFormat_Range.k8G);
    maRef = new ADXL345_I2C(1,ADXL345_I2C.DataFormat_Range.k8G);

    msTir.set(false);
    msTirRev.set(true);
}
项目:desiree    文件Tilter.java   
private Tilter() {
    leadscrew = new BoundedTalon(Constants.TILTER_CHANNEL,Constants.TILTER_UPPER_LIMIT_SWITCH_CHANNEL,Constants.TILTER_LOWER_LIMIT_SWITCH_CHANNEL);
    accel = new ADXL345_I2C(Constants.ACCELEROMETER_CHANNEL,ADXL345_I2C.DataFormat_Range.k2G);
    accelMeasurements = new Vector();
    updateAccel();        
    pendulum = new AnalogChannel(Constants.PENDULUM_CHANNEL);
    enc = new Encoder(Constants.LEADSCREW_ENCODER_A_CHANNEL,Constants.LEADSCREW_ENCODER_B_CHANNEL);
    enc.setdistancePerpulse(Constants.TILTER_disTANCE_PER_pulse);
    enc.start();
    Thread t = new Thread(new Runnable() {
        public void run() {
            Tilter.net = new NetworkIO();
        }
    });
    t.start();
    controller = new PIDController(Constants.PVAL_T,Constants.IVAL_T,Constants.DVAL_T,enc,new PIDOutput() {
        public void pidWrite(double output) {
            setLeadscrewMotor(output);
        }
    }); 
    controller.setPercentTolerance(0.01);
    controller.disable();
    updatePID();
    initialReadingTimer = new Timer();
    initialReadingTimer.schedule(new TimerTask() {

        public void run() {
            initialLeadLength = calcLeadscrewLength(getAveragedAccelBasedAngle());
        }
    },INITIAL_ANGLE_MEASUREMENT_DELAY);
}
项目:Vector    文件O_TenModule.java   
public O_TenPotPIDSource(double initValue,int AnalogInChannel){
    this.initValue = initValue;
    this.pot = new AnalogChannel(AnalogInChannel);
}
项目:aerbot-champs    文件SonarSystem.java   
public void init(Environment environment) {
   sonar = new AnalogChannel(RobotMap.soNAR_CHANNEL);
}
项目:Treecoil-2014    文件Ultrasonic.java   
public Ultrasonic() {
    ultrasonic = new AnalogChannel(ULTRASONIC_CHANNEL);
}
项目:2013_drivebase_proto    文件WsAnalogInput.java   
public WsAnalogInput(int channel) {
    this.analogValue = new DoubleSubject("AnalogInput" + channel);
    this.input = new AnalogChannel(channel);

    analogValue.setValue(startState.getValue());
}
项目:HyperionRobot2014    文件RobotMap.java   
public static void init() {
       visionFrontSonar = new AnalogChannel(2);
       visionFrontSonarSolenoidRelay = new Solenoid(3);

       ColorLedsRelay = new Relay(3);

       FlashingLedsRelay = new Relay(2);

       m_compressor = new Compressor(7,1);

       canonAngleAllWheelAngleMotor = new Talon(1,4);
LiveWindow.addActuator("CanonAngle","AllWheelAngleMotor",(Talon) canonAngleAllWheelAngleMotor);

       canonAngleAnglePot = new AnalogChannel(1,4);
LiveWindow.addSensor("CanonAngle","AnglePot",canonAngleAnglePot);

       canonAngleUpperAngleLimitSwitch = new DigitalInput(1,1);
LiveWindow.addSensor("CanonAngle","UpperAngleLimitSwitch",canonAngleUpperAngleLimitSwitch);

       canonAngleLowerAngleLimitSwitch = new DigitalInput(1,2);
LiveWindow.addSensor("CanonAngle","LowerAngleLimitSwitch",canonAngleLowerAngleLimitSwitch);

       canonSpinnerAllWheelSpinnerMotor = new Talon(1,3);
LiveWindow.addActuator("CanonSpinner","AllWheelSpinnerMotor",(Talon) canonSpinnerAllWheelSpinnerMotor);

       canonShooterShooterSolenoid = new DoubleSolenoid(1,1,2);
LiveWindow.addActuator("CanonShooter","ShooterSolenoid",canonShooterShooterSolenoid);

       canonShooterShooterSolenoid.set(DoubleSolenoid.Value.kReverse);

       driveTrainAllWheelRightMotor = new Talon(1,2);
LiveWindow.addActuator("DriveTrain","AllWheelRightMotor",(Talon) driveTrainAllWheelRightMotor);

       driveTrainAllWheelLeftMotor = new Talon(1,1);
LiveWindow.addActuator("DriveTrain","AllWheelLeftMotor",(Talon) driveTrainAllWheelLeftMotor);

       driveTrainAllWheelRobotDrive = new RobotDrive(driveTrainAllWheelLeftMotor,driveTrainAllWheelRightMotor);

       driveTrainAllWheelRobotDrive.setSafetyEnabled(true);
       driveTrainAllWheelRobotDrive.setExpiration(0.1);
       driveTrainAllWheelRobotDrive.setSensitivity(0.5);
       driveTrainAllWheelRobotDrive.setMaxOutput(1.0);
       driveTrainAllWheelRobotDrive.setInvertedMotor(RobotDrive.MotorType.kRearLeft,false);
       driveTrainAllWheelRobotDrive.setInvertedMotor(RobotDrive.MotorType.kRearRight,false);  

       driveTrainRobotFrameGyro = new Gyro(1,1);
LiveWindow.addSensor("DriveTrain","RobotFrameGyro",driveTrainRobotFrameGyro);
       driveTrainRobotFrameGyro.setSensitivity(0.007);
   }
项目:2014-robot-code    文件Tusks.java   
public Tusks(){
    brake = new DoubleSolenoid(Ports.SHOOTER_BRAKE_1,Ports.SHOOTER_BRAKE_2);
    anglePot = new AnalogChannel(Ports.SHOOTER_ANGLE_POT);
    angler = new Talon(Ports.SHOOTER_ANGLE_CONTROL);
    state = STABLE;
}
项目:Felix-2014    文件Console.java   
public void init() {

    motorLeft = new Talon(1);
    motorRight = new Talon(2);
    System.out.println("[INFO] TALON[1&2]: Created!");
    elToro1 = new Talon(3);
    elToro2 = new Talon(4);
    System.out.println("[INFO] TALON[3&4]: Created!");
    robotdrive = new RobotDriveSteering(motorLeft,motorRight);
    robotdrive.setInvertedMotor(RobotDriveSteering.MotorType.kRearLeft,true);
    robotdrive.setInvertedMotor(RobotDriveSteering.MotorType.kRearRight,true);

    compressor = new Compressor(1,1); // presureSwitchDigitalInput,RelayOut
    compressor.start();

    wormgear = new Relay(2);
    spreader = new Relay(3);
    System.out.println("[INFO] RELAY[1&2&3]: Created!");

    joystick = new Joystick(1);
    //joystick2 = new Joystick(2);
    System.out.println("[INFO] JOYSTICK[1&2]: Created!");

    cock = new Solenoid(1);
    uncock = new Solenoid(2);
    lock = new Solenoid(3);
    fire = new Solenoid(4);

    System.out.println("[INFO] Digital I/O: Enabled.");

    sonic = new Ultrasonic(4,2);
    sonic.setEnabled(true);
    sonic2 = new AnalogChannel(3);
    pot = new AnalogPotentiometer(2,10);

    autonomousTimer = new Timer();
    t = new Timer();

    LCD = DriverStationLCD.getInstance();
    ds = DriverStation.getInstance();

    System.out.println("[INFO] Robot Initialized");
}
项目:AdamBots-2014-FRC-Programming    文件AnalogSwitch.java   
public AnalogSwitch(int channel) {
    swit = new AnalogChannel(channel);
}
项目:AdamBots-2014-FRC-Programming    文件AnalogSwitch.java   
public AnalogSwitch(int card,int channel) {
    swit = new AnalogChannel(card,channel);
}
项目:Robot2014    文件IndicatorLight.java   
/**
 * light of robot and the sonar
 */
public IndicatorLight() {
    sonar = new AnalogChannel(RobotMap.sonar);
    light = new Relay(RobotMap.light,Relay.Direction.kForward);
}
项目:Testbot14-15    文件BTData.java   
public BTData(BTDebugger debug)
{
    //DRIVETRAIN MOTORS
    if (Constants.IS_DT_CANBUS)
    {
        motorFactDT = new BTCanJaguar.Factory(Constants.IS_DT_VOLTAGE,debug);
    }
    else
    {
        motorFactDT = new BTJaguar.Factory(debug);
    }
    if (Constants.IS_SHOOTER_CANBUS)
    {
        motorFactManip = new BTCanJaguar.Factory(Constants.IS_SHOOTER_VOLTAGE,debug);
    }
    else
    {
        motorFactManip = new BTJaguar.Factory(debug);
    }
    MOTOR_R = motorFactDT.makeMotor(Constants.RIGHT_MOTOR_PORT);
    MOTOR_L = motorFactDT.makeMotor(Constants.LEFT_MOTOR_PORT);

    //SHOOTER MOTORS
    MOTOR_Winch = motorFactManip.makeMotor(Constants.WINCH_MOTOR_PORT);
    MOTOR_Collector = motorFactManip.makeMotor(Constants.COLLECTOR_MOTOR_PORT);
    MOTOR_Hinge = motorFactManip.makeMotor(Constants.HINGE_MOTOR_PORT);
    //DRIVETRAIN ENCODERS
    SONAR_Drive = new BTSonar(Constants.soNAR_PORT,1024,true);
    ENCODER_LeftDrive = new BTEncoder(Constants.LEFT_ENCODE_A,Constants.LEFT_ENCODE_B);
    ENCODER_RightDrive = new BTEncoder(Constants.RIGHT_ENCODE_A,Constants.RIGHT_ENCODE_B); //(86.4/128.0)
    ENCODER_LeftDrive.setdistancePerpulse((Constants.WHEEL_CIRCUMFERENCE/Constants.ENCODER_TEETH));
    ENCODER_RightDrive.setdistancePerpulse(Constants.WHEEL_CIRCUMFERENCE/Constants.ENCODER_TEETH);

    ENCODER_Manipwinch = new BTEncoder(Constants.MANIP_SHOOT_ENCODE_A,Constants.MANIP_SHOOT_ENCODE_B);
    ENCODER_Manipwinch.setdistancePerpulse(Constants.MANIP_WHEEL_CIRCUMFERENCE/Constants.ENCODER_TEETH);
    DI_maxLimitSwitch = new BTDigitalInput(Constants.MAX_LIMIT_SWITCH_PORT);
    DI_minLimitSwitch = new BTDigitalInput(Constants.MIN_LIMIT_SWITCH_PORT);
    DI_winchLimit = new BTDigitalInput(Constants.WINCH_LIMIT_SWITCH_PORT);
    //ballDetection = new DigitalInput(Constants.BALL_DETECTION_PORT);

    POT_Hinge = new BTAnalogPot(Constants.HINGE_POT_CHANNEL);
    //POT_Collector = new BTAnalogPot(Constants.COLLECTOR_POT_CHANNEL);
    //SHOOTER PISTON
    PISTON_ManipRelease = new BTPiston(Constants.MANIP_RELEASE_EXTEND_PORT,Constants.MANIP_RELEASE_RETRACT_PORT);
    PISTON_Collector = new BTPiston(Constants.COLLECTOR_PISTON_EXTEND_PORT,Constants.COLLECTOR_PISTON_RETRACT_PORT);
    PISTON_LockAngle = new BTPiston(Constants.LOCK_PISTON_EXTEND_PORT,Constants.LOCK_PISTON_RETRACT_PORT);

    AC_PressureSensor = new AnalogChannel(Constants.PRESSURE_SENSOR_PORT);

    debug.write(Constants.DebugLocation.BTData,Constants.Severity.INFO,"Data Inited");
}
项目:TitanRobot2014    文件ComponentRegistry.java   
public ComponentRegistry() {
    messagedisplay = new Messagedisplay();

    /* Instantiate Drive components */
    leftDriveJoystick = new Joystick(LEFT_DRIVE_JOYSTICK);
    rightDriveJoystick = new Joystick(RIGHT_DRIVE_JOYSTICK);
    operatorJoystick = new Joystick(OPERATOR_JOYSTICK);
    SpeedControllerFactory speedControllerFactory = new SpeedControllerFactory();
    frontLeftDriveMotor = speedControllerFactory.create(FRONT_LEFT_DRIVE_MOTOR_PORT,FRONT_LEFT_DRIVE_SPEED_CONTROLLER,(FRONT_LEFT_DRIVE_MOTOR_DIRECTION==REVERSE));
    frontRightDriveMotor = speedControllerFactory.create(FRONT_RIGHT_DRIVE_MOTOR_PORT,FRONT_RIGHT_DRIVE_SPEED_CONTROLLER,(FRONT_RIGHT_DRIVE_MOTOR_DIRECTION==REVERSE));
    rearLeftDriveMotor = speedControllerFactory.create(REAR_LEFT_DRIVE_MOTOR_PORT,REAR_LEFT_DRIVE_SPEED_CONTROLLER,(REAR_LEFT_DRIVE_MOTOR_DIRECTION==REVERSE));
    rearRightDriveMotor = speedControllerFactory.create(REAR_RIGHT_DRIVE_MOTOR_PORT,REAR_RIGHT_DRIVE_SPEED_CONTROLLER,(REAR_RIGHT_DRIVE_MOTOR_DIRECTION==REVERSE));
    robotDrive = new RobotDrive(frontLeftDriveMotor,rearLeftDriveMotor,frontRightDriveMotor,rearRightDriveMotor);
    reverseDirectionButton = new JoystickButton(leftDriveJoystick,REVERSE_DRIVE_DIRECTION_BUTTON,false);
    speedDragButton = new JoystickButton(rightDriveJoystick,SPEED_DRAG_BUTTON,false);
    speedBoostButton = new JoystickButton(leftDriveJoystick,SPEED_BOOST_BUTTON,false);
    lowSpeedButton = new JoystickButton(leftDriveJoystick,LOW_SPEED_BUTTON,false);
    mediumSpeedButton = new JoystickButton(leftDriveJoystick,MEDIUM_SPEED_BUTTON,true);
    highSpeedButton = new JoystickButton(leftDriveJoystick,HIGH_SPEED_BUTTON,false);

    /* Pickup components */
    pickupStopSwitch = new DigitalInputSwitch(BALL_STOP_SWITCH_CHANNEL,norMALLY_CLOSED);
    pickupMotor = speedControllerFactory.create(PICKUP_MOTOR_PORT,PICKUP_SPEED_CONTROLLER,pickupStopSwitch,null,PICKUP_MOTOR_DIRECTION==REVERSE);
    pickupButton = new JoystickButton(operatorJoystick,PICKUP_BUTTON,false);

    /* Instantiate Switch components */
    leftAutonomousModeSwitch = new DigitalInputSwitch(LEFT_AUTONOMOUS_MODE_CHANNEL,norMALLY_CLOSED);
    rightAutonomousModeSwitch = new DigitalInputSwitch(RIGHT_AUTONOMOUS_MODE_CHANNEL,norMALLY_CLOSED);

    /* Shoulder components */
    analogVoltageMeter = new AnalogChannel(ANALOG_SUPPLY_CHANNEL);
    shoulderPotentiometer = new Potentiometer(ARM_POTENTIOMETER_CHANNEL,analogVoltageMeter,SHOULDER_POTENTIOMETER_DIRECTION==REVERSE,SHOULDER_POTENTIOMETER_SCALE,SHOULDER_POTENTIOMETER_MINIMUM_EDGE,SHOULDER_POTENTIOMETER_MAXIMUM_EDGE);
    armUpLimitSwitch = new DigitalInputSwitch(ARM_UP_LIMIT_SWITCH_CHANNEL,norMALLY_CLOSED);
    armDownLimitSwitch = new DigitalInputSwitch(ARM_DOWN_LIMIT_SWITCH_CHANNEL,norMALLY_CLOSED);
    shoulderMotor = speedControllerFactory.create(SHOULDER_MOTOR_PORT,armUpLimitSwitch,armDownLimitSwitch,SHOULDER_MOTOR_DIRECTION==REVERSE);
    pickupPositionButton = new JoystickButton(operatorJoystick,SHOULDER_PICKUP_POSITION_BUTTON,false);
    lowShotPositionButton = new JoystickButton(operatorJoystick,SHOULDER_LOW_SHOT_POSITION_BUTTON,false);
    highShotPositionButton = new JoystickButton(operatorJoystick,SHOULDER_HIGH_SHOT_POSITION_BUTTON,false);
    seekShotButton = new JoystickButton(operatorJoystick,SHOULDER_SEEK_SHOT_BUTTON,false);
    startPositionButton = new JoystickButton(operatorJoystick,SHOULDER_START_POSITION_BUTTON,false);
    manualPositionButton = new JoystickButton(operatorJoystick,SHOULDER_MANUAL_MODE_BUTTON,false);
    distanceSensor = new MaxSonardistanceSensor(disTANCE_SENSOR_CHANNEL,analogVoltageMeter);
    shootingdistanceSwitch = new MaxSonardistanceSwitch(distanceSensor,AUTO_SHOOT_disTANCE,AUTO_SHOOT_disTANCE_TOLERANCE,false);

    /* Hammer components */
    hammerMotor = speedControllerFactory.create(LATCH_MOTOR_PORT,LATCH_SPEED_CONTROLLER,LATCH_MOTOR_DIRECTION==REVERSE);
    hammerFireButton = new JoystickButton(operatorJoystick,HAMMER_FIRE_BUTTON,false);
    hammerLatchButton = new JoystickButton(operatorJoystick,LATCH_LOCK_BUTTON,false);
    hammerLatchedSwitch = new DigitalInputSwitch(HAMMER_LATCHED_SWITCH_CHANNEL,norMALLY_CLOSED);
    hammerLockedSwitch = new DigitalInputSwitch(HAMMER_LOCKED_SWITCH_CHANNEL,norMALLY_CLOSED);
    autoShootButton = new JoystickButton(operatorJoystick,AUTO_SHOOT_BUTTON,false);
    reversePickupButton = new JoystickButton(operatorJoystick,REVERSE_PICKUP_BUTTON,false);

    /* Indicator light components */
    Relay indicatorLightsspikeRelay = new Relay(INDICATOR_LIGHTS_CHANNEL);
    shootdistanceLightRelay = new SimpleRelay(indicatorLightsspikeRelay,SHOOT_disTANCE_LIGHT_RELAY);
    hammerLatchedLightRelay = new SimpleRelay(indicatorLightsspikeRelay,LATCH_LOCKED_LIGHT_RELAY);

    parkRobotButton = new JoystickButton(rightDriveJoystick,PARK_ROBOT_BUTTON,false);
}
项目:TitanRobot2014    文件ComponentRegistry.java   
public AnalogChannel getAnalogVoltageMeter() {
    return analogVoltageMeter;
}
项目:TitanRobot2014    文件MaxSonardistanceSensor.java   
public MaxSonardistanceSensor(int pMaxSonarChannel,AnalogChannel pAnalogVoltageMeter) {
    maxSonar = new AnalogChannel(pMaxSonarChannel);
    analogVoltageMeter = pAnalogVoltageMeter;
}
项目:TitanRobot2014    文件InfraredSwitch.java   
public InfraredSwitch(int pInfraredDetectorChannel,int pOnState) {
    this(pInfraredDetectorChannel,pAnalogVoltageMeter,pHammerLevel,pOnState,false);
}
项目:Storm2014    文件StringPot.java   
public StringPot(int channelNum) {
    _channel = new AnalogChannel(channelNum);
}
项目:Storm2014    文件MagneticEncoder.java   
public MagneticEncoder(int channelNum) {
    _channel = new AnalogChannel(channelNum);
}
项目:Storm2014    文件LoadSensor.java   
public LoadSensor(int channel){
    loadSensor = new AnalogChannel(channel);
}
项目:Storm2014    文件CurrentSensor.java   
public CurrentSensor(int channel){
    currentSensor = new AnalogChannel(channel);
}
项目:Team_3200_2014_Aerial_Assist    文件RangeFinderBall.java   
/**
 * Create the range finder.
 * @param analogModule The analog module it is in
 * @param channel The channel it is in
 */
public RangeFinderBall(int analogModule,int channel) {
    rangeFinder = new AnalogChannel(analogModule,channel);
    SmartDashboard.putNumber("Ball In Voltage",1.4);
    SmartDashboard.putNumber("Ball Range Voltage",0);
}
项目:2014-Robot    文件Ranger.java   
public Ranger(int channel) {
    sensor = new AnalogChannel(channel);
}
项目:2014-Robot    文件Ranger.java   
public AnalogChannel getSensor(){
    return sensor;
}
项目:2014_software    文件WsAnalogInput.java   
public WsAnalogInput(int channel) {
    this.analogValue = new DoubleSubject("AnalogInput" + channel);
    this.input = new AnalogChannel(channel);

    analogValue.setValue(0.0);
}
项目:FRC623Robot2014    文件RobotHardware.java   
public AnalogChannel getSonar() {
    return sonar;
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。