108 xyz->
x = ((Buffer[1] << 8) | Buffer[2])>> 2;
109 xyz->
y = ((Buffer[3] << 8) | Buffer[4])>> 2;
110 xyz->
z = ((Buffer[5] << 8) | Buffer[6])>> 2;
130 double X_G, Y_G, Z_G;
135 xyz.
x = ((Buffer[1] << 8) | Buffer[2])>> 2;
136 xyz.
y = ((Buffer[3] << 8) | Buffer[4])>> 2;
137 xyz.
z = ((Buffer[5] << 8) | Buffer[6])>> 2;
145 pitch = 57.2957795 * atan(X_G/(sqrt((Y_G*Y_G)+(Z_G*Z_G))));
146 roll = 57.2957795 * atan(Y_G/(sqrt((X_G*X_G)+(Z_G*Z_G))));
149 pitch =
static_cast<int> (pitch*100+0.5) / 100.0;
150 roll =
static_cast<int> (roll *100+0.5) / 100.0;
153 PitchRoll->
pitch = (int) (pitch*100);
154 PitchRoll->
roll = (int) (roll*100);
#define FXLS8471Q_READ_LEN
#define FXLS8471Q_CTRL_REG3
#define FXLS8471Q_CTRL_REG2
#define FXLS8471Q_Sensitivity
#define FXLS8471Q_XYZ_DATA_CFG
void goToSleep()
This method sets the Accelerometer in Standby.
uint8_t getAccXYZ(FXLS8471Q::structXYZ *xyz)
This method returns the values of the X, Y and Z axis of the Accelerometer FXLS8471Q.
#define FXLS8471Q_CTRL_REG1
uint8_t getAccPitchRoll(FXLS8471Q::structPitchRoll *PitchRoll)
This method returns the values of the pitch and roll angles of the Accelerometer FXLS8471Q.
void init(uint8_t slaveAddr)
This method initializes the Accelerometer FXLS8471Q.