ADXL345 Accelerometer on I2C.
Definition: ADXL345_I2C.h:29
I2C m_i2c
Definition: ADXL345_I2C.h:81
static constexpr int kDataFormatRegister
Definition: ADXL345_I2C.h:91
void SetRange(Range range) final
Common interface for setting the measuring range of an accelerometer.
static constexpr int kAddress
Definition: ADXL345_I2C.h:89
virtual double GetAcceleration(Axes axis)
Get the acceleration of one axis in Gs.
PowerCtlFields
Definition: ADXL345_I2C.h:95
@ kPowerCtl_Sleep
Definition: ADXL345_I2C.h:99
@ kPowerCtl_AutoSleep
Definition: ADXL345_I2C.h:97
@ kPowerCtl_Link
Definition: ADXL345_I2C.h:96
@ kPowerCtl_Measure
Definition: ADXL345_I2C.h:98
hal::SimDouble m_simX
Definition: ADXL345_I2C.h:85
hal::SimEnum m_simRange
Definition: ADXL345_I2C.h:84
~ADXL345_I2C() override=default
int GetI2CDeviceAddress() const
static constexpr int kDataRegister
Definition: ADXL345_I2C.h:92
ADXL345_I2C & operator=(ADXL345_I2C &&)=default
hal::SimDouble m_simZ
Definition: ADXL345_I2C.h:87
virtual AllAxes GetAccelerations()
Get the acceleration of all axes in Gs.
static constexpr double kGsPerLSB
Definition: ADXL345_I2C.h:93
static constexpr int kPowerCtlRegister
Definition: ADXL345_I2C.h:90
double GetX() override
Common interface for getting the x axis acceleration.
Axes
Definition: ADXL345_I2C.h:31
@ kAxis_X
Definition: ADXL345_I2C.h:31
@ kAxis_Y
Definition: ADXL345_I2C.h:31
@ kAxis_Z
Definition: ADXL345_I2C.h:31
ADXL345_I2C(I2C::Port port, Range range=kRange_2G, int deviceAddress=kAddress)
Constructs the ADXL345 Accelerometer over I2C.
hal::SimDouble m_simY
Definition: ADXL345_I2C.h:86
void InitSendable(nt::NTSendableBuilder &builder) override
Initializes this Sendable object.
hal::SimDevice m_simDevice
Definition: ADXL345_I2C.h:83
double GetZ() override
Common interface for getting the z axis acceleration.
ADXL345_I2C(ADXL345_I2C &&)=default
DataFormatFields
Definition: ADXL345_I2C.h:102
@ kDataFormat_SelfTest
Definition: ADXL345_I2C.h:103
@ kDataFormat_IntInvert
Definition: ADXL345_I2C.h:105
@ kDataFormat_Justify
Definition: ADXL345_I2C.h:107
@ kDataFormat_FullRes
Definition: ADXL345_I2C.h:106
@ kDataFormat_SPI
Definition: ADXL345_I2C.h:104
I2C::Port GetI2CPort() const
double GetY() override
Common interface for getting the y axis acceleration.
Interface for 3-axis accelerometers.
Definition: Accelerometer.h:12
Range
Definition: Accelerometer.h:20
@ kRange_2G
Definition: Accelerometer.h:20
I2C bus interface class.
Definition: I2C.h:23
Definition: NTSendableBuilder.h:18
Interface for NetworkTable Sendable objects.
Definition: NTSendable.h:16
A helper class for use with objects that add themselves to SendableRegistry.
Definition: SendableHelper.h:19
Definition: AprilTagFieldLayout.h:22
Definition: ADXL345_I2C.h:33
double XAxis
Definition: ADXL345_I2C.h:34
double YAxis
Definition: ADXL345_I2C.h:35
double ZAxis
Definition: ADXL345_I2C.h:36