当前位置: 首页>>代码示例>>Java>>正文


Java DriverStationLCD类代码示例

本文整理汇总了Java中edu.wpi.first.wpilibj.DriverStationLCD的典型用法代码示例。如果您正苦于以下问题:Java DriverStationLCD类的具体用法?Java DriverStationLCD怎么用?Java DriverStationLCD使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DriverStationLCD类属于edu.wpi.first.wpilibj包,在下文中一共展示了DriverStationLCD类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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() {
    // instantiate the command used for the autonomous period
    autonomousCommand = new AutonomousGroup();
    
    // Initialize all subsystems
    CommandBase.init();
    
    // Ouput program info to system log.
    System.out.println("+---------------------------------------------+");
    System.out.println("| Team "+teamNo+" - Software Version: "+versionNo+" |");
    System.out.println("+---------------------------------------------+");
    
    // Output program info to driver station.
    DriverStationLCD.getInstance().println(DriverStationLCD.Line.kUser1, 1, "Team: "+teamNo+" - Software Version: "+versionNo);
    DriverStationLCD.getInstance().println(DriverStationLCD.Line.kUser2, 2, "Robot initialized.");
    DriverStationLCD.getInstance().updateLCD();
}
 
开发者ID:BVT-Team-61,项目名称:Robot-Base,代码行数:22,代码来源:BasicRobot.java

示例2: 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();
}
 
开发者ID:CarmelRobotics,项目名称:aeronautical-facilitation,代码行数:21,代码来源:DriveTrain.java

示例3: 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****");
}
 
开发者ID:Team2168,项目名称:2014_Main_Robot,代码行数:24,代码来源:Robot.java

示例4: disabledPeriodic

import edu.wpi.first.wpilibj.DriverStationLCD; //导入依赖的package包/类
/**
 * This method is run repeatedly while the robot is disabled.
 */
public void disabledPeriodic() {
	//get auto selection from dashboard and write it to lcd
	autonomousCommand = (AutoCommandGroup) autoChooser.getSelected();
	lcd.println(DriverStationLCD.Line.kUser2, 1, autonomousCommand.getName());
	lcd.updateLCD();

	//Kill all active commands
	Scheduler.getInstance().removeAll();
	Scheduler.getInstance().disable();

	//Check to see if the gyro is drifting, if it is re-initialize it.
	gyroReinit();
	
	//set arduino lights
	setArduinoAutonomousStatuses();
}
 
开发者ID:Team2168,项目名称:2014_Main_Robot,代码行数:20,代码来源:Robot.java

示例5: 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();
}
 
开发者ID:KProskuryakov,项目名称:FRC623Robot2014,代码行数:26,代码来源:Robot623.java

示例6: 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();
}
 
开发者ID:KProskuryakov,项目名称:FRC623Robot2013-2,代码行数:25,代码来源:Robot.java

示例7: dsPrintln

import edu.wpi.first.wpilibj.DriverStationLCD; //导入依赖的package包/类
private static void dsPrintln(String data) {
    dsBuffer.addElement(data);
    dsBuffer.removeElementAt(0);

    dash.println(DriverStationLCD.Line.kUser1, 1,
            (String) dsBuffer.elementAt(5));
    dash.println(DriverStationLCD.Line.kUser6, 1,
            (String) dsBuffer.elementAt(4));
    dash.println(DriverStationLCD.Line.kUser5, 1,
            (String) dsBuffer.elementAt(3));
    dash.println(DriverStationLCD.Line.kUser4, 1,
            (String) dsBuffer.elementAt(2));
    dash.println(DriverStationLCD.Line.kUser3, 1,
            (String) dsBuffer.elementAt(1));
    dash.println(DriverStationLCD.Line.kUser2, 1,
            (String) dsBuffer.elementAt(0));

    dash.updateLCD();
}
 
开发者ID:grt192,项目名称:2013ultimate-ascent,代码行数:20,代码来源:GRTLogger.java

示例8: getControlMode

import edu.wpi.first.wpilibj.DriverStationLCD; //导入依赖的package包/类
public ControlMode getControlMode()
{
    if (controlMode.value == ControlMode.arcadeDrive.value)
    {
        DriverStationComm.printMessage(DriverStationLCD.Line.kUser1, 1, "Control mode: Arcade 2 Joystick");
    }
    else if (controlMode.value == ControlMode.tankDrive.value)    
    {
        DriverStationComm.printMessage(DriverStationLCD.Line.kUser1, 1, "Control mode: Tank");
    }
    else
    {
        DriverStationComm.printMessage(DriverStationLCD.Line.kUser1, 1, "Control mode: Arcade 1 Joystick");
    }
    
    return controlMode;
}
 
开发者ID:SaintsRobotics,项目名称:Woodchuck-2013,代码行数:18,代码来源:JoystickControl.java

示例9: controlAutoAim

import edu.wpi.first.wpilibj.DriverStationLCD; //导入依赖的package包/类
/**
 * Very messy method. Shouldn't be that hard to figure out though. Read
 * through it carefully. :P
 */
public static void controlAutoAim() {
    if (toggleFeed == false) {
        if (autoAimButton.get() == true) {
            Angle.setAngle(Vision.calculateAngle());
            AutoCenter.lineUpTarget();
        } else if (autoAngleButton.get() == true) {
            Angle.setAngle(2.00);
        } //Angle Control code below is for testing, calibrating, and manual shooting if problems arise.    
        else if (raiseAngleButton.get() == true) {
            Angle.angleUp();
        } else if (lowerAngleButton.get() == true) {
            Angle.angleDown();
            LCD.println(DriverStationLCD.Line.kUser4, 1, "lowering angleeee");
        } else {
            Angle.angleStop();
        }
    } else { //If toggleFeed is now true and climbButton is not pressed, go to feeder angle
        Angle.setAngle(feederAngle); //Feeder Angle (Approximately)
    }
}
 
开发者ID:PeterMitrano,项目名称:293-2013,代码行数:25,代码来源:OI.java

示例10: lineUpTarget

import edu.wpi.first.wpilibj.DriverStationLCD; //导入依赖的package包/类
/**
 * This code might require a bit of operator control. If the robot is moving
 * too fast, it will over shoot and start oscillating. Operator must know
 * when to let go of the button. Following should be self-explanatory. Join
 * the build team if you do not understand.
 */
public static void lineUpTarget() {
    if (Vision.centerOfGravity() < largeMaxLeftBound) {
        DriveTrain.rotateDrive(largeTurningRightSpeed);
        LCD.println(DriverStationLCD.Line.kUser1, 1, "...Turning Left...");
    } else if (Vision.centerOfGravity() > largeMaxRightBound) {
        DriveTrain.rotateDrive(largeTurningLeftSpeed);
        LCD.println(DriverStationLCD.Line.kUser1, 1, "...Turning Right...");
    } else {
        if (Vision.centerOfGravity() < smallMaxLeftBound) { //Space between the last dot is to check that the loop is working correctly. 
            DriveTrain.rotateDrive(smallTurningRightSpeed);
            LCD.println(DriverStationLCD.Line.kUser1, 1, "...Turning Left.. .");
        } else if (Vision.centerOfGravity() > smallMaxRightBound) {
            DriveTrain.rotateDrive(smallTurningLeftSpeed);
            LCD.println(DriverStationLCD.Line.kUser1, 1, "...Turning Right.. .");
        } else {
            DriveTrain.tankDrive(0, 0);
            LCD.println(DriverStationLCD.Line.kUser1, 1, "<Centered on Target>");
        }
    }
}
 
开发者ID:PeterMitrano,项目名称:293-2013,代码行数:27,代码来源:AutoCenter.java

示例11: sayNOCLEAR

import edu.wpi.first.wpilibj.DriverStationLCD; //导入依赖的package包/类
/**
 * Display a line of text without scrolling. Max 21 characters / line.
 * <p/>
 * @param ln Which line to print in
 * @param msg What message to display
 */
public void sayNOCLEAR(int ln, String msg) {
    if (msg == null) {
        msg = "null message passed";
    }
    // DriverStationLCD.kLineLength=21
    // Add 21 spaces to clear the rest of the line
    msg += "                     ";
    // If the given message is too long, truncate it
    if (msg.length() > 21) {
        msg = msg.substring(0, 21);
    }

    switch (ln) {
        case (1):
            output.println(DriverStationLCD.Line.kUser1, 1, msg);
            break;
        case (2):
            output.println(DriverStationLCD.Line.kUser2, 1, msg);
            break;
        case (3):
            output.println(DriverStationLCD.Line.kUser3, 1, msg);
            break;
        case (4):
            output.println(DriverStationLCD.Line.kUser4, 1, msg);
            break;
        case (5):
            output.println(DriverStationLCD.Line.kUser5, 1, msg);
            break;
        case (6):
            output.println(DriverStationLCD.Line.kUser6, 1, msg);
            break;
    }

    // Show the message
    output.updateLCD();
}
 
开发者ID:frc2879,项目名称:2014-mermaid,代码行数:43,代码来源:DSOutput.java

示例12: autonomousInit

import edu.wpi.first.wpilibj.DriverStationLCD; //导入依赖的package包/类
public void autonomousInit() {
    // schedule the autonomous command (example)
    //autonomousCommand.start();
    
    // Ouput status info to driver station.
    DriverStationLCD.getInstance().println(DriverStationLCD.Line.kUser3, 2, "Started Autonomous.");
}
 
开发者ID:BVT-Team-61,项目名称:Robot-Base,代码行数:8,代码来源:BasicRobot.java

示例13: teleopInit

import edu.wpi.first.wpilibj.DriverStationLCD; //导入依赖的package包/类
public void teleopInit() {
// This makes sure that the autonomous stops running when
       // teleop starts running. If you want the autonomous to 
       // continue until interrupted by another command, remove
       // this line or comment it out.
       autonomousCommand.cancel();
       
       // Output status info to driver station.
       DriverStationLCD.getInstance().println(DriverStationLCD.Line.kUser3, 2, "Started Tele-op.");
   }
 
开发者ID:BVT-Team-61,项目名称:Robot-Base,代码行数:11,代码来源:BasicRobot.java

示例14: testPeriodic

import edu.wpi.first.wpilibj.DriverStationLCD; //导入依赖的package包/类
/**
 * This function is called periodically during test mode
 */
public void testPeriodic() {
    LiveWindow.run();
    
    // Output status info to driver station.
    DriverStationLCD.getInstance().println(DriverStationLCD.Line.kUser3, 2, "Started Test Mode.");
}
 
开发者ID:BVT-Team-61,项目名称:Robot-Base,代码行数:10,代码来源:BasicRobot.java

示例15: log

import edu.wpi.first.wpilibj.DriverStationLCD; //导入依赖的package包/类
/**
 * Log to Driver Station LCD.
 *
 * @param ln The line number from 1 to 6.
 * @param col The column - either 1 or 2.
 * @param text The line to send.
 */
public static void log(int ln, int col, String text) {
    Line line = lines[ln - 1];
    int pos = col == 1 ? 1 : (DriverStationLCD.kLineLength / 2);

    text = text.trim();//.substring(0, (DriverStationLCD.kLineLength / 2) - 1); // Constrain

    clearLine(ln);
    ds.println(line, pos, text);
    update();
}
 
开发者ID:OASTEM,项目名称:2014CataBot,代码行数:18,代码来源:Debug.java


注:本文中的edu.wpi.first.wpilibj.DriverStationLCD类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。