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


Java SmartDashboard.getString方法代码示例

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


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

示例1: autonInit

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
public void autonInit() {
	// these are what we will type in for the according auton
	final String defaultAuton = "default";
	final String AutonLeft = "Left";
	final String AutonCenter = "Center";
	final String AutonRight = "Right";
	
	SendableChooser<String> chooser = new SendableChooser<>();
	// autoSelected = chooser.getSelected();
	String autonSelected = SmartDashboard.getString("Auto Selector", defaultAuton);
	System.out.println("Auto selected: " + autonSelected);
	
	String gameData = DriverStation.getInstance().getGameSpecificMessage();
	
	if(autonSelected == AutonLeft) {
		//left side start auton
		if(gameData.charAt(0) == 'R') {
			// drive forwards to a position for defense or make way to left side
		}else if(gameData.charAt(0) == 'L') {
			// goes to left side switch and attempts to place block
			
		}else {
			// Default Auton based off starting position
		}
		
	}else if(autonSelected == AutonCenter) {
		// center start auton
		if(gameData.charAt(1) == 'R') {
			// goes to right side switch and attempts to place block
		}else if(gameData.charAt(1) == 'L') {
			// goes to left side switch and attempts to place block
			
		}else {
			// Default Auton based off starting position
		}
		
	}else if(autonSelected == AutonRight) {
		// right side start auton
		if(gameData.charAt(0) == 'R') {
			// goes to right side switch and attempts to place block
		}else if(gameData.charAt(0) == 'L') {
			// drives forwards to a position for defense or make way to left side
			
		}else {
			// Default Auton based off starting position
		}
		
	}else {
		// Default [Drive 12FT straight]
		
	}
}
 
开发者ID:RED-M0CKING-LINE,项目名称:Team5183Robot2018J,代码行数:53,代码来源:Auton.java

示例2: getString

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
public static String getString(String name, String defaultValue) {
	return SmartDashboard.getString(name, defaultValue);
}
 
开发者ID:Team997Coders,项目名称:2017SteamBot2,代码行数:4,代码来源:CustomDashboard.java


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