本文整理汇总了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();
}
示例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();
}
示例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();
}