View Single Post
  #1   Spotlight this post!  
Unread 31-01-2015, 20:01
bussell bussell is offline
Registered User
AKA: Joe Bussell
FRC #2521 (SERT)
Team Role: Mentor
 
Join Date: Oct 2014
Rookie Year: 2009
Location: United States
Posts: 7
bussell is an unknown quantity at this point
Re: FRC Java Implementation of the SparkFun 6 Degrees of Freedom IMU Digital Combo Bo

Usage:

In our Sensors class:
private ADXL345_I2C_SparkFun m_accel;
private GyroITG3200 m_gyro;

In our Sensors() constructor:
m_accel = new ADXL345_I2C_SparkFun(I2C.Port.kOnboard, Accelerometer.Range.k16G);

m_gyro = new GyroITG3200(I2C.Port.kOnboard);
m_gyro.initialize();
Methods to get Gyro data:
public double getAngleX() {
return m_gyro.getRotationX();
}

public double getAngleY() {
return m_gyro.getRotationY();
}

public double getAngleZ() {
return m_gyro.getRotationZ();
}
Reply With Quote