本文整理汇总了Java中edu.wpi.first.wpilibj.DriverStationLCD.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java DriverStationLCD.getInstance方法的具体用法?Java DriverStationLCD.getInstance怎么用?Java DriverStationLCD.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.wpi.first.wpilibj.DriverStationLCD
的用法示例。
在下文中一共展示了DriverStationLCD.getInstance方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DriveTrain
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
/**
*
*/
public DriveTrain() {
super("DriveTrain");
FLeftMotor = new Victor(RobotMap.FLeftMotorPWM);
FRightMotor = new Victor(RobotMap.FRightMotorPWM);
BLeftMotor = new Victor(RobotMap.BLeftMotorPWM);
BRightMotor = new Victor(RobotMap.BRightMotorPWM);
//MLeftMotor = new Victor(RobotMap.MLeftMotorPWM);
//MRightMotor = new Victor(RobotMap.MRightMotorPWM);
drive = new RobotDrive(FLeftMotor, BLeftMotor, FRightMotor, BRightMotor);
//drive.setInvertedMotor(RobotDrive.MotorType.kFrontRight, true);
//drive.setInvertedMotor(RobotDrive.MotorType.kRearLeft, true);
GShiftSolDown = new Solenoid(RobotMap.DriveTrainLowGearSolenoid);
GShiftSolUp = new Solenoid(RobotMap.DriveTrainHighGearSolenoid);
display = DriverStationLCD.getInstance();
}
示例2: robotInit
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
/**
* This method is run when the robot is first powered on.
*/
public void robotInit() {
//initialize compressor
compressor = new Compressor(RobotMap.pressureSwitch.getInt(), RobotMap.compressorRelay.getInt());
// Initialize all subsystems
CommandBase.init();
//Initialize auto mode chooser
autoSelectInit();
//create thread to write dashboard variables
printer = new ConsolePrinter(200);
printer.startThread();
//init message box on driverstation
lcd = DriverStationLCD.getInstance();
//Console Message so we know robot finished loading
System.out.println("****Robot Done Loading****");
}
示例3: printToDash
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
public static void printToDash(int line, String str) {
DriverStationLCD dsLCD = DriverStationLCD.getInstance();
dsLCD.clear();
switch (line) {
case 1:
dsLCD.println(DriverStationLCD.Line.kUser1, 1, str);
break;
case 2:
dsLCD.println(DriverStationLCD.Line.kUser2, 1, str);
break;
case 3:
dsLCD.println(DriverStationLCD.Line.kUser3, 1, str);
break;
case 4:
dsLCD.println(DriverStationLCD.Line.kUser4, 1, str);
break;
case 5:
dsLCD.println(DriverStationLCD.Line.kUser5, 1, str);
break;
case 6:
dsLCD.println(DriverStationLCD.Line.kUser6, 1, str);
break;
}
dsLCD.updateLCD();
}
示例4: printToDash
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
private void printToDash(int line, String str) {
DriverStationLCD dsLCD = DriverStationLCD.getInstance();
switch (line) {
case 1:
dsLCD.println(DriverStationLCD.Line.kUser1, 1, str);
break;
case 2:
dsLCD.println(DriverStationLCD.Line.kUser2, 1, str);
break;
case 3:
dsLCD.println(DriverStationLCD.Line.kUser3, 1, str);
break;
case 4:
dsLCD.println(DriverStationLCD.Line.kUser4, 1, str);
break;
case 5:
dsLCD.println(DriverStationLCD.Line.kUser5, 1, str);
break;
case 6:
dsLCD.println(DriverStationLCD.Line.kUser6, 1, str);
break;
}
dsLCD.updateLCD();
}
示例5: Pass
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
/**
*
*/
public Pass() {
super("Pass");
launcher = AeronauticalFacilitation.getLauncher();
requires(launcher);
display = DriverStationLCD.getInstance();
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
}
示例6: Launch
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
/**
*
*/
public Launch() {
super("Launch");
launcher = AeronauticalFacilitation.getLauncher();
requires(launcher);
display = DriverStationLCD.getInstance();
//TODO: add roller = here
//TODO: add requires(roller) here
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
}
示例7: robotInit
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
/**
*
*/
public void robotInit() {
// instantiate the command used for the autonomous period
DriveTrain = new DriveTrain();
launchercontroller = new Launcher();
rollerSubsystem = new Roller();
display = DriverStationLCD.getInstance();
compressor = new Compressor(RobotMap.PressureSwitchDigitalInput, RobotMap.CompressorRelay);
compressor.start();
DriveTrain.shiftHighGear();
OI.initialize();
autonomousCommand = new Autonomous();
arduino = new ArduinoConnection();
arduino.setPattern("4");
pattern = 0;
driverStation = DriverStation.getInstance();
alliance = driverStation.getAlliance().value;
digital1 = driverStation.getDigitalIn(1);
digital2 = driverStation.getDigitalIn(2);
digital3 = driverStation.getDigitalIn(3);
// Initialize all subsystems.
// Subsystems: a self-contained system within a larger system.
CommandBase.init();
}
示例8: robotInit
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public void robotInit() {
System.out.println("[INFO] ****** ROBOT IS READY FOR USE ******");
// Tell programmer(s)/Console reader that the Robot is initialized
// and will now call console.init(); and then run the loop when the
// VM initialization is complete.
console.init();
// clears LCD Driver Station.
LCD = DriverStationLCD.getInstance();
LCD.clear();
}
示例9: MessageDisplay
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
public MessageDisplay() {
driverStationLCD = DriverStationLCD.getInstance();
displayLines = new DriverStationLCD.Line[6];
displayLines[0] = DriverStationLCD.Line.kUser1;
displayLines[1] = DriverStationLCD.Line.kUser2;
displayLines[2] = DriverStationLCD.Line.kUser3;
displayLines[3] = DriverStationLCD.Line.kUser4;
displayLines[4] = DriverStationLCD.Line.kUser5;
displayLines[5] = DriverStationLCD.Line.kUser6;
}
示例10: RobotTemplate
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
public RobotTemplate() {
// initialize all the objects
ingest = new VictorPair(5,6);
elevator = new Victor(1);
shooter = new VictorPair(2,4);
robotDrive = new Drive(8, 7, 10, 9);
xbox = new JStick(1);
joystick = new JStick(2);
compressor = new Compressor(4, 3);
compressor.start();
driveGearA = new Solenoid(1);
driveGearB = new Solenoid(2);
driveGearA.set(true);
driveGearB.set(false);
selectedGear = 1;
leftEnc = new Encoder(6, 7, true,CounterBase.EncodingType.k2X);
leftEnc.setDistancePerPulse(0.103672558);
rightEnc = new Encoder(9, 10, false);
rightEnc.setDistancePerPulse(0.103672558);
lcd = DriverStationLCD.getInstance();
}
示例11: VisionTrackingCommand
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
public VisionTrackingCommand(){
super("VisionTracking");
lifter = Components.getInstance().lifter;
drivetrainRotation = Components.getInstance().drivetrainRotation;
requires(lifter);
requires(drivetrainRotation);
visionTable = NetworkTable.getTable("vision");
xPIDSource = new TargetXPIDSource();
yPIDSource = new TargetYPIDSource();
xPIDController = new PIDController(xP, xI, xD, xF, xPIDSource, drivetrainRotation);
xPIDConfig = PIDTuningManager.getInstance().getPIDConfig("Vision Horizontal");
yPIDController = new PIDController(yP, yI, yD, yF, yPIDSource, lifter);
yPIDConfig = PIDTuningManager.getInstance().getPIDConfig("Vision Vertical");
textOutput = DriverStationLCD.getInstance();
}
示例12: robotInit
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
protected void robotInit()
{
m_LeftDriveMotor = new Victor(SLOT, LEFT_MOTOR_CHANNEL); //cRIO Slot,Channel
m_RightDriveMotor = new Victor(SLOT, RIGHT_MOTOR_CHANNEL);
//m_ArmMotor = new Victor(SLOT, ARM_MOTOR);
m_FrisbeeMotor = new Victor(SLOT, FRISBEE_MOTOR);
m_Driver = new Joystick(1); //USB Port
m_Secondary = new Joystick(2);
m_RobotDrive = new RobotDrive(m_LeftDriveMotor, m_RightDriveMotor);
m_Compressor = new Compressor(14, 1); //Pressure switch channel,Relay channel
m_Compressor.start();
//m_ArmSolIn = new Solenoid(SOL_ARM_IN);
//m_ArmSolOut = new Solenoid(SOL_ARM_OUT);
m_FrisbeeSolIn = new Solenoid(SOL_FRISBEE_IN);
m_FrisbeeSolOut = new Solenoid(SOL_FRISBEE_OUT);
m_Lights = new Solenoid(SOL_LIGHTS);
//m_ArmPist = new Piston(m_ArmSolIn, m_ArmSolOut, false, true, 3);
m_FrisbeePist = new Piston(m_FrisbeeSolIn, m_FrisbeeSolOut, true, false, 0.5f);
m_Shooter = new Shooter(m_FrisbeePist, m_FrisbeeMotor, 1);
//m_ArmTop = new DigitalInput(ARMTOP); //Channel
//m_ArmBot = new DigitalInput(ARMBOT);
m_LCD = DriverStationLCD.getInstance();
}
示例13: DSOutput
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
/**
* Make a new DSOutput instance. Not hard.
*/
public DSOutput() {
output = DriverStationLCD.getInstance();
}
示例14: init
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
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");
}