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


Java SerialPort.reset方法代码示例

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


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

示例1: IMU

import edu.wpi.first.wpilibj.SerialPort; //导入方法依赖的package包/类
/**
 * Constructs the IMU class, overriding the default update rate
 * with a custom rate which may be from 4 to 100, representing
 * the number of updates per second sent by the nav6 IMU.  
 *
 * Note that increasing the update rate may increase the
 * CPU utilization.
 * @param serial_port BufferingSerialPort object to use
 * @param update_rate_hz Custom Update Rate (Hz)
 */
public IMU(SerialPort serial_port, byte update_rate_hz) {
    ypr_update_data = new IMUProtocol.YPRUpdate();
    this.update_rate_hz = update_rate_hz;
    flags = 0;
    accel_fsr_g = DEFAULT_ACCEL_FSR_G;
    gyro_fsr_dps = DEFAULT_GYRO_FSR_DPS;
    this.serial_port = serial_port;
    yaw_history = new float[YAW_HISTORY_LENGTH];
    yaw = (float) 0.0;
    pitch = (float) 0.0;
    roll = (float) 0.0;
    try {
        serial_port.reset();
    } catch (RuntimeException ex) {
        ex.printStackTrace();
    }
    initIMU();
    m_thread = new Thread(this);
    m_thread.start();        
}
 
开发者ID:FRC2832,项目名称:Robot_2016,代码行数:31,代码来源:IMU.java

示例2: IMU

import edu.wpi.first.wpilibj.SerialPort; //导入方法依赖的package包/类
public IMU(SerialPort serial_port, byte update_rate_hz) {
	ypr_update_data = new IMUProtocol.YPRUpdate();
	this.update_rate_hz = update_rate_hz;
	flags = 0;
	accel_fsr_g = DEFAULT_ACCEL_FSR_G;
	gyro_fsr_dps = DEFAULT_GYRO_FSR_DPS;
	this.serial_port = serial_port;
	yaw_history = new float[YAW_HISTORY_LENGTH];
	yaw = (float) 0.0;
	pitch = (float) 0.0;
	roll = (float) 0.0;
	try {
		serial_port.reset();
	} catch (RuntimeException e) {
	}
	initIMU();
	m_thread = new Thread(this);
	m_thread.start();
}
 
开发者ID:Prospect-Robotics,项目名称:2016Robot,代码行数:20,代码来源:IMU.java

示例3: IMU

import edu.wpi.first.wpilibj.SerialPort; //导入方法依赖的package包/类
/**
 * Constructs the IMU class, overriding the default update rate
 * with a custom rate which may be from 4 to 100, representing
 * the number of updates per second sent by the nav6 IMU.  
 * 
 * Note that increasing the update rate may increase the 
 * CPU utilization.
 * @param serial_port BufferingSerialPort object to use
 * @param update_rate_hz Custom Update Rate (Hz)
 */
public IMU(SerialPort serial_port, byte update_rate_hz) {
    ypr_update_data = new IMUProtocol.YPRUpdate();
    this.update_rate_hz = update_rate_hz;
    flags = 0;
    accel_fsr_g = DEFAULT_ACCEL_FSR_G;
    gyro_fsr_dps = DEFAULT_GYRO_FSR_DPS;
    this.serial_port = serial_port;
    yaw_history = new float[YAW_HISTORY_LENGTH];
    yaw = (float) 0.0;
    pitch = (float) 0.0;
    roll = (float) 0.0;
    try {
        serial_port.reset();
    } catch (RuntimeException ex) {
        ex.printStackTrace();
    }
    initIMU();
    m_thread = new Thread(this);
    m_thread.start();        
}
 
开发者ID:FRC5442,项目名称:Bernie,代码行数:31,代码来源:IMU.java


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