當前位置: 首頁>>代碼示例>>Java>>正文


Java SmartDashboard.getBoolean方法代碼示例

本文整理匯總了Java中edu.wpi.first.wpilibj.smartdashboard.SmartDashboard.getBoolean方法的典型用法代碼示例。如果您正苦於以下問題:Java SmartDashboard.getBoolean方法的具體用法?Java SmartDashboard.getBoolean怎麽用?Java SmartDashboard.getBoolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在edu.wpi.first.wpilibj.smartdashboard.SmartDashboard的用法示例。


在下文中一共展示了SmartDashboard.getBoolean方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: readTestingEnvironment

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //導入方法依賴的package包/類
/**
   * grabs values from testing environment
   */
  public void readTestingEnvironment() {
  	RobotConstants.isInverted = SmartDashboard.getBoolean("isInverted", false);
RobotConstants.isTrigger = SmartDashboard.getBoolean("isTrigger", false);

RobotConstants.AUTO_SPEED = SmartDashboard.getNumber("AUTO_SPEED", 0);
RobotConstants.AUTO_SPEED = SmartDashboard.getNumber("INCHES_TO_ENCODER", 0);

RobotConstants.AUTO_DRIVE_TOLERANCE = SmartDashboard.getNumber("AUTO_DRIVE_TOLERANCE", 0);
RobotConstants.AUTO_DRIVE_RHOOK_D1 = SmartDashboard.getNumber("AUTO_DRIVE_RHOOK_D1", 0);
RobotConstants.AUTO_DRIVE_RHOOK_D2 = SmartDashboard.getNumber("AUTO_DRIVE_RHOOK_D2", 0);
RobotConstants.AUTO_DRIVE_LHOOK_D1 = SmartDashboard.getNumber("AUTO_DRIVE_LHOOK_D1", 0);
RobotConstants.AUTO_DRIVE_LHOOK_D2 = SmartDashboard.getNumber("AUTO_DRIVE_LHOOK_D2", 0);
RobotConstants.AUTO_DRIVE_MHOOK_D1 = SmartDashboard.getNumber("AUTO_DRIVE_MHOOK_D1", 0);
RobotConstants.AUTO_DRIVE_P = SmartDashboard.getNumber("AUTO_DRIVE_P", 0);
RobotConstants.AUTO_DRIVE_I = SmartDashboard.getNumber("AUTO_DRIVE_I", 0);
RobotConstants.AUTO_DRIVE_D = SmartDashboard.getNumber("AUTO_DRIVE_D", 0);

RobotConstants.AUTO_TURN_TOLERANCE = (int) SmartDashboard.getNumber("AUTO_TURN_TOLERANCE", 0);
RobotConstants.AUTO_TURN_RHOOK_SETPOINT = (int) SmartDashboard.getNumber("AUTO_TURN_RHOOK_SETPOINT", 0);
RobotConstants.AUTO_TURN_LHOOK_SETPOINT = (int) SmartDashboard.getNumber("AUTO_TURN_LHOOK_SETPOINT", 0);
RobotConstants.AUTO_TURN_P = SmartDashboard.getNumber("AUTO_TURN_P", 0);
RobotConstants.AUTO_TURN_I = SmartDashboard.getNumber("AUTO_TURN_I", 0);
RobotConstants.AUTO_TURN_D = SmartDashboard.getNumber("AUTO_TURN_D", 0);

RobotConstants.FLYWHEEL_SPEED = SmartDashboard.getNumber("FLYWHEEL_SPEED", 0);

RobotConstants.VISION_TOLERANCE = (int) SmartDashboard.getNumber("VISION_TOLERANCE", 0);
RobotConstants.VISION_X_SETPOINT = (int) SmartDashboard.getNumber("VISION_X_SETPOINT", 0);
RobotConstants.VISION_Y_SETPOINT = (int) SmartDashboard.getNumber("VISION_Y_SETPOINT", 0);
RobotConstants.VISION_P = SmartDashboard.getNumber("VISION_P", 0);
RobotConstants.VISION_I = SmartDashboard.getNumber("VISION_I", 0);
RobotConstants.VISION_D = SmartDashboard.getNumber("VISION_D", 0);

RobotConstants.GEAR_TOLERANCE = SmartDashboard.getNumber("GEAR_TOLERANCE", 0);
RobotConstants.GEAR_INIT_SETPOINT = SmartDashboard.getNumber("GEAR_INIT_SETPOINT", 0);
RobotConstants.GEAR_FINAL_SETPOINT = SmartDashboard.getNumber("GEAR_FINAL_SETPOINT", 0);
RobotConstants.GEAR_P = SmartDashboard.getNumber("GEAR_P", 0);
RobotConstants.GEAR_I = SmartDashboard.getNumber("GEAR_I", 0);
RobotConstants.GEAR_D = SmartDashboard.getNumber("GEAR_D", 0);
  }
 
開發者ID:Team4914,項目名稱:2017-emmet,代碼行數:44,代碼來源:Robot.java

示例2: getBoolean

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //導入方法依賴的package包/類
public static boolean getBoolean(String key, boolean defaultValue) {
	return SmartDashboard.getBoolean(key, defaultValue);
}
 
開發者ID:Team997Coders,項目名稱:2017SteamBot2,代碼行數:4,代碼來源:CustomDashboard.java


注:本文中的edu.wpi.first.wpilibj.smartdashboard.SmartDashboard.getBoolean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。