public class AccelerometerADXL345 extends I2CComponent
Datasheet: ADXL345
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ADXL345_ADDRESS
Default i2c ADXL345 address.
|
device, MAX_I2C_ADDRESS, MIN_I2C_ADDRESS
Constructor and Description |
---|
AccelerometerADXL345()
Constructor for a new ADXL345, using the default i2c ADXL345 address.
|
AccelerometerADXL345(int i2cAddress)
Constructor for a new ADXL345, using a specific i2c address.
|
Modifier and Type | Method and Description |
---|---|
double[] |
getGAcceleration()
Get the current acceleration, read from the ADXL345.
|
double |
getPitchAngle()
Get the pitch angle.
|
double |
getScale()
Get the scale that should be used when the device is in full resolution mode.
|
void |
setScale(double scale)
Sets the scale that should be used when the device is in full resolution mode.
|
getDevice, getType, readSignedRegisterValue, readTwoSignedRegsiters, readTwoUnsignedRegisters, readUnsignedRegisterValue, writeUnsignedValueDirectlyToI2CDevice, writeUnsignedValueToRegister
public static final int DEFAULT_ADXL345_ADDRESS
public AccelerometerADXL345()
public AccelerometerADXL345(int i2cAddress)
i2cAddress
- the i2c address of the ADXL345.public double getScale()
public void setScale(double scale)
scale
- the new scale to use when the device is in full resolution mode.public double[] getGAcceleration()
public double getPitchAngle()