29 requestBytes(MPU_address, ACCEL_XOUT_H, 6);
36 ax = ((int16_t)rawData[0] << 8) | rawData[1];
37 ay = ((int16_t)rawData[2] << 8) | rawData[3];
38 az = ((int16_t)rawData[4] << 8) | rawData[5];
46 requestBytes(MPU_address, GYRO_XOUT_H, 6);
51 gx = ((int16_t)rawData[0] << 8) | rawData[1];
52 gy = ((int16_t)rawData[2] << 8) | rawData[3];
53 gz = ((int16_t)rawData[4] << 8) | rawData[5];
61 requestBytes(MAG_address, MAG_XOUT_L, 8);
66 mx = ((int16_t)rawData[0] << 8) | rawData[1];
67 my = ((int16_t)rawData[2] << 8) | rawData[3];
68 mz = ((int16_t)rawData[4] << 8) | rawData[5];
77 requestBytes(MPU_address, TEMP_OUT_H, 2);
82 return ((int16_t)rawData[0] << 8) | rawData[1];
void read_mag()
Read readings from magnetometer.
void read_acc()
Read readings from accelerometer.
int16_t read_temp()
Take a reading of the temperature.
void read_gyro()
Read readings from gyroscope.
Main header of the library.