edu.wpi.first.wpilibj
Class ADXL345_I2C

java.lang.Object
  extended by edu.wpi.first.wpilibj.SensorBase
      extended by edu.wpi.first.wpilibj.ADXL345_I2C
All Implemented Interfaces:
FrcBotSimComponent

public class ADXL345_I2C
extends SensorBase

Author:
dtjones

Nested Class Summary
static class ADXL345_I2C.AllAxes
           
static class ADXL345_I2C.Axes
           
static class ADXL345_I2C.DataFormat_Range
           
 
Field Summary
 
Fields inherited from class edu.wpi.first.wpilibj.SensorBase
kAnalogChannels, kAnalogModules, kDigitalChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond, n_simProperties
 
Constructor Summary
ADXL345_I2C(int slot, ADXL345_I2C.DataFormat_Range range)
          Constructor.
 
Method Summary
 double getAcceleration(ADXL345_I2C.Axes axis)
          Get the acceleration of one axis in Gs.
 ADXL345_I2C.AllAxes getAccelerations()
          Get the acceleration of all axes in Gs.
 
Methods inherited from class edu.wpi.first.wpilibj.SensorBase
checkAnalogChannel, checkAnalogModule, checkDigitalChannel, checkDigitalModule, checkPWMChannel, checkPWMModule, checkRelayChannel, checkRelayModule, checkSolenoidChannel, checkSolenoidModule, free, getDefaultAnalogModule, getDefaultDigitalModule, getDefaultSolenoidModule, getSimProperties, setDefaultAnalogModule, setDefaultDigitalModule, setDefaultSolenoidModule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ADXL345_I2C

public ADXL345_I2C(int slot,
                   ADXL345_I2C.DataFormat_Range range)
Constructor.

Parameters:
slot - The slot of the digital module that the sensor is plugged into.
range - The range (+ or -) that the accelerometer will measure.
Method Detail

getAcceleration

public double getAcceleration(ADXL345_I2C.Axes axis)
Get the acceleration of one axis in Gs.

Parameters:
axis - The axis to read from.
Returns:
Acceleration of the ADXL345 in Gs.

getAccelerations

public ADXL345_I2C.AllAxes getAccelerations()
Get the acceleration of all axes in Gs.

Returns:
Acceleration measured on all axes of the ADXL345 in Gs.